Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Answered

Creating dynamic expression for Marketing Email's "To address" field

(0) ShareShare
ReportReport
Posted on by 5

Hello everyone,

In my Dynamics 365 for Marketing contacts, I have contacts who have email addresses in the fields emailaddress1, emailaddress2 and emailaddress3. I have created a marketing email that I want to send to contacts in a segment comprising contacts with emails in any of these fields.

Is there a way for me to write a dynamic expression in the "To address" in the marketing email such that for each contact, the system checks for a valid email address in emailaddress1 field, then emailaddress2, then emailaddress3 fields? The first field where valid data is found should be selected and the marketing email should be sent to that address.

Best regards

  • slx Profile Picture
    slx 386 on at
    RE: Creating dynamic expression for Marketing Email's "To address" field

    Why field {{contact.emailaddress1}} cannot be updated?

    "To address: This should almost always be set to {{ contact.emailaddress1 }}, which sends the message to each contact included in the customer journey that sends the email. You might change this to use a different email address field (such as emailaddress2), or enter a dynamic expression that chooses the best of several available email fields."

  • Verified answer
    Nya Profile Picture
    Nya 29,058 on at
    RE: Creating dynamic expression for Marketing Email's "To address" field

    Hi Fola,

    Yes, it will permanently copy the email address in emailaddress2 or emailaddress3 to the emailaddress1 field with my solution.

    Then how about copy the valid email address to emailaddress2 or 3 or a custom email field, which can be set as invisible to others?

    It can be achieved in a similar way.

    You just need to adjust the conditions and steps in the workflow and set the dynamic expression as something like {{ contact.emailaddress2 }} , {{ contact.emailaddress3 }} or {{ contact.the name of the custom field }}.

  • Fola Lana Profile Picture
    Fola Lana 5 on at
    RE: Creating dynamic expression for Marketing Email's "To address" field

    Thank you for your response Nya.

    A bit more context to help. The reason some contacts have email addresses in emailaddress2 and emailaddress3 fields is because some teams do not want the email addresses of their contacts visible to everyone else using the CRM. The configured views and forms for contacts only show emailaddress1. However, when segments are created for marketing emails, some of these contacts without email addresses in emailaddress1 field are included in these segments and the goal is to have the marketing email delivered to them as well.

    So, I am looking for a temporary solution that ensures the marketing email targets not only the emailaddress1 field, but also emailaddress2 and emailaddress3. I do not want to permanently write values to the emailaddress1 field if no email address was written in there initially.

    Am I right in understanding that the approach of creating an on-demand workflow will permanently copy the email address in emailaddress2 or emailaddress3 to the emailaddress1 field?

    Regards,

    Fola

  • Verified answer
    Nya Profile Picture
    Nya 29,058 on at
    RE: Creating dynamic expression for Marketing Email's "To address" field

    Hi,

    Assuming that some of the Email Address fields are empty, we can use the following workflow to handle these fields.

    1. Create an on-demand workflow.

     pastedimage1627887774057v1.png

    1. If Email does not contain data and Email Address 2 contains data, then set the value of Email Address 2 as the value of Email.

     pastedimage1627887783572v2.png

    1. If Email and Email Address 2 do not contain data, and Email Address 3 contains data, then set the value of Email Address 3 as the value of Email.

     pastedimage1627887790415v3.png

    The workflow allows to ensure that the emailaddress1 always has a value if one of the addresses contains data.

  • Fola Lana Profile Picture
    Fola Lana 5 on at
    RE: Creating dynamic expression for Marketing Email's "To address" field

    Thank you for your response Nya.

    Pardon my use of the term "valid" in the initial question. It is not relevant for this issue since all email addresses in these fields are valid as you rightly stated. The main challenge is about how to get the email sent to the email addresses in emailaddress2 and emailaddress3 since the system sends emails to emailaddress1 by default.

  • Suggested answer
    Nya Profile Picture
    Nya 29,058 on at
    RE: Creating dynamic expression for Marketing Email's "To address" field

    Hi,

    Would you please explain your definition of Valid?

    Due to the type of the email field, if the input value is an invalid email, it cannot be saved.

     pastedimage1627871457233v1.png

    If there are other rules for the format, the request cannot be achieved by dynamic expression.

    It is recommended to create an on-demand workflow targeting at Contact entity, which checks the email addresses one by one and sets the value to emailaddress1 if you find a valid one.

    Then insert the workflow into the customer journey to process the contacts who are going to be sent the email. So that you don’t need to modify the dynamic expression of the Marketing Email's "To address" field.

    pastedimage1627871466319v2.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,836 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans