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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilitat
- Inventari
- PoS
- Project
- MRP
This question has been flagged
2
Respostes
3189
Vistes
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
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Registrar-se
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.