You need to have a python code that will generate the mail and send. You can place the below code (and modify it to fit your needs) in the model for which you want to send email, and than call the method send_mail("name of the temlate") from the code that handles your form submission, or I prefer to have a workflow associated with the model and send mail from the actions in the workflow.
def send_mail(self, cr, uid, ids, context=None, template=""):
for object in self.browse(cr, uid, ids, context=context):
# Check if the parnter has "opt_out" for the mail
if (not object.partner_id.opt_out):
template_id = self.pool.get('email.template').search(cr, uid, [("name","=",template)])
mail_message = self.pool.get('email.template').send_mail(cr,uid,template_id,object.id)
you can sent the email automatically by using server actions.
You see the following link for using the automated email:
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 2/11/15, 2:44 AM|
|Seen: 2204 times|
|Last updated: 9/27/16, 1:21 AM|