NeoVe
NeoVe

Reputation: 3897

Sending email from website frontpage Odoo v9 community

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

Answers (1)

sfx
sfx

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

Related Questions