6 Replies Latest reply on Feb 5, 2019 1:17 PM by Sanford Whiteman

    Velocity script to vary the From Address based on segmentation 

    Patrick Vincler

      Hi everyone,

       

      I've got a beans and bacon question for this amazing community here.  The beans - segmentation. The bacon - Velocity scripting.

       

      What I'm trying to do:

      Use a token in the From Address field, to vary our sender email address. Do this by condition of segmentation that is referenced in the script token.

       

      My testing methodology:

      Purely by sending an email though the campaign. No test emails sends or previews.

       

      What I've covered already:

      Have ticked the check box in right hand panel for the variable.  (Segmentation_Clubs_1003)

       

      My Code:

      #if($lead.Segmentation_Clubs_1003 == "Client1")
          info@client1.com
      #elseif($lead.Segmentation_Clubs_1003 == "Client2")
          info@client2.com
      #elseif($lead.Segmentation_Clubs_1003 == "Client3")
          info@client3.com
      #elseif($lead.Segmentation_Clubs_1003 == "Client4")
          info@client4.com
      #elseif($lead.Segmentation_Clubs_1003 == "Client5")
          info@clent5.com
      #elseif($lead.Segmentation_Clubs_1003 == "Client6")
          info@client6.com
      #elseif($lead.Segmentation_Clubs_1003 == "Clent7")
          info@client7.com
      #else
          info@standard.com
      #end
      

      Results:

      Email delivers but only displays the default from address (info@standard.com)

       

      Any insight is much appreciated! Thank you!