Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Contact Form assign salesperson and notify via Email

By
Pedro Soares
on 8/30/16, 6:40 AM 351 views

Can someone guide me on how can I assign a Lead when a public user contacts with Contact Form and notify the sales person with an email?



0
Diogo Duarte
On 11/18/16, 6:08 AM

Hi Pedro,

This will go into some XML file

<!-- Email template for ...-->
<record id="email_template1" model="mail.template">
<field name="name">Got new leads</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="email_from"><![CDATA[Sender Name <${(object.company_id.email or user.email)|safe}>]]></field>
<field name="email_to">${object.email_from|safe}</field>
<field name="reply_to">email@domain.com</field>
<field name="subject">Got new Leads</field>
<field name="body_html"><![CDATA[<h3>Got new Lead:</h3>
<p>Server url.</p>
<p>More text</p>]]></field>
</record>

This in to crm_lead

class Lead(models.Model): 
_inherit = 'crm.lead'

@api.mode
def send_email_demo(self, id):
template = self.env['ir.model.data'].get_object('module_name', 'email_template1')
template.send_mail(id, force_send=True, raise_exception=True)

Your Answer

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

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 8/30/16, 6:40 AM
Seen: 351 times
Last updated: 11/18/16, 6:08 AM