SOLVED

Re: Using a sub-domain for SPF/DKIM/DMARC authentication - to tighten security

Go to solution
Dan_Stevens_
Level 10 - Champion Alumni

Re: Using a sub-domain for SPF/DKIM/DMARC authentication - to tighten security

Hi Courtney - yeah, that's what our security team mentioned as well.  For example, if we have a campaign where we want to include a "first.last@marketing.avanade.com", the Exchange team can add this additional email/sub-domain to the user's record (or like you said, even a rule for all users)

The issue here is - when we're dynamically pulling in account owner email addresses - using the "account.owner email" token - the actual FROM/REPLY-TO addresses will contain the actual email address, not the address with the sub-domain.

Casey_Grimes
Level 10

Re: Using a sub-domain for SPF/DKIM/DMARC authentication - to tighten security

Oh! Easy enough:

#set( $email = ${lead.Sales Owner Email Address} )

#set( $domain = "marketing.demandlab.com" )

#set( $final = $email.replace("demandlab.com", ${domain}) )

${final}

Dan_Stevens_
Level 10 - Champion Alumni

Re: Using a sub-domain for SPF/DKIM/DMARC authentication - to tighten security

Wow, thanks Courtney - that was easy!  Brings back memories of my ASP/vbscript days. I definitely need to do more with velocity in Marketo.

Dan_Stevens_
Level 10 - Champion Alumni

Re: Using a sub-domain for SPF/DKIM/DMARC authentication - to tighten security

I have this working using the following script:

#set( $email = ${lead.Avanade_BD_Owner_EmailAddress} )

#set( $domain = "@marketing.avanade.com" )

#set( $final = $email.replace("@avanade.com", ${domain}) )

${final}

Except when there is no value for "Avanade Sales BD EmailAddress".  It doesn't appear velocity script tokens use the DEFAULT value for when there is a NULL value:

{{my.Transformed BD Email Address:default=info@marketing.avanade.com}}

What other approach can I use to use a fallback value when the value is NULL/empty?

SanfordWhiteman
Level 10 - Community Moderator

Re: Using a sub-domain for SPF/DKIM/DMARC authentication - to tighten security

With Velocity, you output the default from the token itself, e.g.

#set( $defaultEmail = "info@marketing.avanade.com" )

#set( $email = ${lead.Avanade_BD_Owner_EmailAddress} )

#set( $domain = "@marketing.avanade.com" )

#set( $final = $email.replace("@avanade.com", ${domain}) )

#if( $final.isEmpty() )

#set( $final = $defaultEmail )

#end

${final}

Dan_Stevens_
Level 10 - Champion Alumni

Re: Using a sub-domain for SPF/DKIM/DMARC authentication - to tighten security

Perfect - thanks Sandy!