Skip to content

Script: SignatureByFrom

SamuelPlentz edited this page Aug 1, 2020 · 1 revision

If you don't use the signature function in Thunderbird or have several occasions where you want to change the signature depending on the chosen sending address afterwards you can insert the corresponding signature with this script e.g.

So this script makes sense if you use more than one sending e-mailaddress.

Script

// Read the e-mailaddress in FROM header to variable emailaddress
var emailaddress = this.mVariables[0];

// Depending on e-mailaddress return signature
switch (emailaddress) {
    case "[email protected]":
    case "[email protected]":
        return
            "Kind Regards\n" + 
            "\n" +
            "Your Name\n" +
            "\n" +
            "\n" +
            "\n" +
            "--\n" +
            "Your Firm\n" +
            "Address1\n" +
            "Address2\n" +
            "Address3\n" +
            "Country\n" +
            "\n" +
            "Phone: ...\n" +
            "Web: ...\n" +
            "E-Mail: ..."
        break;

    case "[email protected]":
        return
            "Kind Regards\n" +
            "\n" +
            "Your Name";
        break;

    case "[email protected]":
        return "Greetings...";
}

Usage

Using this script anywhere in your template would append the custom signature depending on the corresponding e-mailaddress:

[[SCRIPT=SignatureByFrom|[[FROM=email]]]]