Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
3192 Prikazi

I would like an email to be triggered to go to the lead when it  comes in from our wordpress website.    How do I start?

Avatar
Opusti

Checkout the automated action in Settings -> Technical -> Automation -> automated actions. You can created the trigger based on created . Next tab in 'Server actions to run'

create the email trigger.

Best Answer

Hi Jacquelyn Zalar,

 You have to first configure outgoing mail server of Odoo to send an email from Odoo.Then create a mail template in XML file.   e.g.

  <record id="email_template" model="mail.template">

         <field name="name">name of template</field>
         <field name="email_from">email address of sender</field>
         <field name="subject">subject of email</field>
         <field name="model_id" ref="base.model_ir_ui_view"/>
         <field name="body_html"><![CDATA[
       <p>
     Your mail-content
    </p>
         ]]></field>
     </record>

    Then write below python code in file where you have written code for leads

    template_id = request.env['ir.model.data'].get_object_reference(your module name,mail template id(email_template))

    template_obj = request.env['mail.template'].browse(template_id)
    template_obj.email_to = receiver's mail address
    template_obj.send_mail(page.id, force_send=True)

Hope this will helpful to you!

Thanks


Avatar
Opusti