Help

3

How can I set custom from and reply-to addresses in email templates?

Avatar
Javier Fuentes

Hi,

I have been making tests to set up some email templates to contact our clients. These are the addressing settings I am using for one of these templates:

From: ${object-user_id.email}

To (Emails): ${object.email}

To (Partners): ${object.id}

Reply-To:

These are my questions:

  • The e-mail is correctly sent, but the from address when the email is received shows the outgoing email address of the system and not the email of the user. How could I set the From field so that the user's address is shown?
  • I would like to address the potential responses to an email alias (i.e. marketing@mydoamin.com) so that a lead is created when anyone answers the mail. How could I set this alias address (marketing@mydomain.com) in the Reply-to field?

Thank you very much. Regards,

Javier

Avatar
Discard
4 Answers
1
Avatar
Javier Fuentes
Best Answer

Thank you very much for your response GEM. I am not sure I've understood well the solution your have proposed. Following your comment, this is how I have configured the addressing information of the template:

From: (blank)

To (Emails): ${object.email}

To (Partners): ${object.id}

Reply-To: marketing@mydomain.com

I have sent a sample email using this template as one of the users of the system and this is what I have obtained:

  • Sender address is still the e-mail of the configured outgoing mail address (not the address of the user sending the email)
  • If a try to reply-to the received e-mail, the destination address is the address of the user.

What am I doing wrong?

Thank you for your time. Regards,

Javier

Avatar
Discard
1
Best Answer

Hi,

user should have an email given in his account, no need to enter a value in field FROM, see the code :

    'email_from': fields.char('From',
        help="Sender address (placeholders may be used here). If not set, the default "
                "value will be the author's email alias if configured, or email address."),

to have a different address for the reply, give the value address you want in field reply to.

    'reply_to': fields.char('Reply-To', help="Preferred response address (placeholders may be used here)"),

Bye

Avatar
Discard
0
Best Answer

Any one show is interested and fall o this question, here is how you do it in xml:

<record id="yourdirectory.yourprefered_id" model="mail.template">

<field name="email_from">info@yourcompany.com</field>

  <field name="reply_to">info@yourcompany.com</field>

  <field name="email_to">${object.model_field_representing_email}</field>

  <field name="subject">bla bla bla</field>

...

</record>

Avatar
Discard
0
Avatar
Dale
Best Answer

Thanks for this thread. Tell me please, I want to create a template that is available from the drop down when sending a new mail by clicking the envelope icon next to the user name in the top right corner. What is the correct model to add the template to so that it appears in this drop down?

thanks

Avatar
Discard