Reputation: 3897
I know this might seem odd
But is there a way to send an email with a specific template from a website module in Odoo ?
I mean, suppose I have a button on website, this button should call for a template on backend and send the email automatically.
Any example of this I should look for?
I've looked for website_crm
, website_form
and website_blog
but I don't see any example like that.
Upvotes: 0
Views: 144
Reputation: 1841
@api.model
def send_mail_function(self):
template_id = self.env.ref('custom_crm.mail_template_id')
if template_id:
template_id.send_mail(self.id, force_send=True)
return True
Upvotes: 1