Is there a way to change the signature dynamically depending on which sending server is used?

jhall95

Member
I have a few gmail servers that send sometimes and each one is linked up to a user, so if my template has a signature it won't align with the sender.

Can twig or some other function in mailwizz help with this?
 
The easiest way around this is to fetch the signature from a remote url depending on the given delivery server, by using the REMOTE_CONTENT tag and DS_* tags to identify the delivery server. However, this adds network latency, so it might not be desired.
Another way is to add a custom tag and parse it accordingly, something like:
Code:
<?php

Yii::app()->hooks->addFilter('campaigns_get_common_tags_search_replace', function($searchReplace, $campaign, $subscriber, $server) {
    
    if (empty($server)) {
        return $searchReplace;
    }

    $signatureTag = '[DS_CUSTOM_SIGNATURE]';
    $signature = '';

    if ($server->server_id == 1) {
        $signature = 'Signature 1';
    } elseif ($server->server_id == 2) {
        $signature = 'Signature 2';
    }

    $searchReplace[$signatureTag] = $signature;


    return $searchReplace;
});
^ This goes in apps/common/init-custom.php

Then you can simply use [DS_CUSTOM_SIGNATURE] tag in your email campaigns.
 
This is the one that gives you most control.
You can also use campaign footers and put some template tags logic (with twig) there.

Do you need the signature to be connected to the delivery server? In the sense that there should be a field in the delivery server settings to add the signature? If that's the case, how would you solve for when a delivery server is used for different sender?
 
Back
Top