Skip to content
Snippets Groups Projects
Commit c33129ed authored by konykon's avatar konykon
Browse files

Send email to sender

parent 86dfb20c
No related branches found
No related tags found
2 merge requests!195[REL] 14.0.2.0.0,!161Fix/edit email templates
This commit is part of merge request !195. Comments created here will be created in the context of that merge request.
......@@ -31,11 +31,8 @@
<field name="name">Confirmation Email for CE Creation Lead Receipt</field>
<field name="email_from">${object.company_id.email}</field>
<field name="subject">[Somcomunitats.coop] New Community Creation Request to the platform</field>
<field name="email_to">${object.email_from}</field>
<field name="email_cc">${object.company_id.email}</field>
<field name="reply_to">${object.company_id.email}</field>
<field name="email_to">${ctx.get('email_to')}</field>
<field name="model_id" ref="model_crm_lead" />
<field name="auto_delete" eval="True" />
<field name="lang">${ctx.get('lang')}</field>
<field name="body_html"><![CDATA[
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
......
......@@ -34,19 +34,20 @@ class CRMLeadService(Component):
template_external_id = self._get_autoresponder_email_template(
target_source_xml_id
)
# add followers
self.add_follower(self.env["crm.lead"].browse(crm_lead_id))
# send auto responder email and notify admins
email_values = {
"email_to": params["email_from"],
"lang": lang
}
if template_external_id:
template = self.env.ref(
"energy_communities.{}".format(template_external_id)
)
template.with_context(email_values).send_mail(crm_lead["id"])
# Add template to chatter message
self.env["crm.lead"].post_template_to_chatter(template.id)
).with_context(email_values)
template.send_mail(force_send=True, res_id=crm_lead_id)
return crm_lead
def _setup_lead_utm_source(self, lead_id, source_xml_id):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment