Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion website_mass_mailing_double_opt_in/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ def _prepare_mail_content(self, mailing_list_contact, language):
<p>{best_regards}<br />{team}</p>
</div>
""",
"email_from": request.env.user.partner_id.email,
"email_from": request.env.company.sudo().default_from_email
or request.env.company.sudo().partner_id.email,
"email_to": mailing_list_contact.contact_id.email,
"state": "outgoing",
}
Expand Down
3 changes: 3 additions & 0 deletions website_mass_mailing_double_opt_in/data/mail_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<field name="name">Newsletter Subscription</field>
<field name="subject">Confirm your newsletter subscription</field>
<field name="model_id" ref="mass_mailing.model_mailing_subscription" />
<field
name="email_from"
>{{ object.env.company.default_from_email or object.env.company.partner_id.email }}</field>
<field name="email_to">{{ object.contact_id.email }}</field>
<field name="body_html" type="html">
<div style="margin: -10px -10px; padding:50px 30px 50px 30px; height:100%;">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ def _prepare_mail_content(self, mailing_list_contact, language):
"""Newsletter Subscribed email template content"""
res = super()._prepare_mail_content(mailing_list_contact, language)
# Get company information
user = request.env.user
company = user.company_id or request.env.company
company = request.env.company.sudo()
if language == "de_DE":
# Update subject
res["subject"] = "Sie haben den Nitrokey Newsletter abonniert"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<field name="name">[Nitrokey Shop] Newsletter Subscription</field>
<field name="subject">Confirm your newsletter subscription</field>
<field name="model_id" ref="mass_mailing.model_mailing_subscription" />
<field
name="email_from"
>{{ object.env.company.default_from_email or object.env.company.partner_id.email }}</field>
<field name="email_to">{{ object.contact_id.email }}</field>
<field name="body_html" type="html">
<div style="margin: -10px -10px; padding:50px 30px 50px 30px; height:100%;">
Expand Down
Loading