Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

Validate Email Address on Email Marketing feature

(0) ShareShare
ReportReport
Posted on by 80

Hi all,

On Marketing Emails, when user design and go-live email, there is any tool or script that we can validate email address/ form name with the specific rules? Without validate, email can be sent out with misstype, fake or scam email address to a huge segment. User can type in without any restriction.

pastedimage1656410964944v1.png

  • Duy Bao VN1 Profile Picture
    Duy Bao VN1 80 on at
    RE: Validate Email Address on Email Marketing feature

    Can we add more condition in this script?

    such as From address/ from name need to be exact matched with below value in the defined list, if not match, show error and stop golive

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Validate Email Address on Email Marketing feature

    Hi Duy Bao VN1,

    According to your description, I use JS script to implement verification email address.

    21.png

    Below is the JS code:

    function validateEmail(execuationContext)

    {

    var formContext = execuationContext.getFormContext();

    var fromEmailAddress = formContext.getAttribute("msdyncrm_fromemail").getValue();

    console.log(fromEmailAddress);

    var mailformat = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;

    if(fromEmailAddress.match(mailformat))

      {

        alert("Valid email address!");

      }

    else

      {

        alert("Invalid email address!");

      }

    }

    Find this field and add this JS code in the Events tab.  Save and publish.

    8508.png

    23.png

    Here are the test results:

    24.png

    25.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,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,842 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans