How to insert merge tag?

Discussion in 'General discussions' started by Lakjin, Nov 24, 2016.

  1. Lakjin

    Lakjin Active Member

    Joined:
    Mar 1, 2015
    Messages:
    391
    Likes Received:
    29
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    6
    Elastic Email requires {unsubscribe} merge tag. We can do this: {unsubscribe:http://to-unsub-link.com}. In apps/common/components/helpers/CampaignHelper.php I've put this:
    if ($server->type == 'elasticemail-web-api') {$unsubscribeUrl = '{unsubscribe:'.$unsubscribeUrl.'}';} right before $searchReplace['[UNSUBSCRIBE_URL]'] = $unsubscribeUrl;

    This works when sending a test email within campaign setup but does not seem to work when sending an actual campaign. Any tips?

    thanks!
     
  2. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,109
    Likes Received:
    2,348
    Why hacking the code when you can insert that by using the Campaigns Footers option ?
     
  3. Lakjin

    Lakjin Active Member

    Joined:
    Mar 1, 2015
    Messages:
    391
    Likes Received:
    29
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    6
    I don't think I can put a conditional statement in campaign footers can I?
     
  4. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,109
    Likes Received:
    2,348
    @Lakjin - You can use conditions in th emails/email footers but we don't make the delivery server type available there. let me find a way to inject this automatically.
     
  5. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,109
    Likes Received:
    2,348
    Meanwhile, you can simply put that tag in your email footers but simply put it in a hidden div and include the regular [UNSUBSCRIBE_URL] as well, but not in a hidden div.
     
  6. Lakjin

    Lakjin Active Member

    Joined:
    Mar 1, 2015
    Messages:
    391
    Likes Received:
    29
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    6
    I thought about doing that, but i'd prefer to just insert the merge tag. While you figure out how to bake this into MailWizz, can you tell me how I can hack the code temporarily? Why does what I do only work for campaign preview emails and not campaigns themselves.
     
  7. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,109
    Likes Received:
    2,348
    It should not. That function you are hacking is used everywhere, including by the send-campaigns command.
     
  8. Lakjin

    Lakjin Active Member

    Joined:
    Mar 1, 2015
    Messages:
    391
    Likes Received:
    29
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    6
    I think what is happening is, the HTML parser is pulling out the merge tag when sending campaigns but not when sending a preview. I've implemented your method of display:none; on a div; I'm hoping you will be able to add this natively in a MailWizz update. Also, anyway to designate a bounce server when using Elasitc Email API? They offer the ability to send bounces to an email, and I'l like to process them.
     
  9. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,109
    Likes Received:
    2,348
    I think you can simply create a bounce server and add that email in EE. It should just work.
     
  10. Lakjin

    Lakjin Active Member

    Joined:
    Mar 1, 2015
    Messages:
    391
    Likes Received:
    29
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    6
    Oh, I thought Bounce Servers have to be associated with Delivery Servers. So simply creating a bounce server will tell MailWizz to start process bounces in it, even if I don't have it associated with a delivery server?
     
  11. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,109
    Likes Received:
    2,348
    The only point why we need to do this association is so that we know what email to put in the ReturnPath header when sending through that DS.
    Bounce processing itself does not depend on this association.
     
  12. Lakjin

    Lakjin Active Member

    Joined:
    Mar 1, 2015
    Messages:
    391
    Likes Received:
    29
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    6
    Ah, okay. Thank you.
     

Share This Page