Adjusting sender name based on region

If you send a lot of mailings, you’ve probably used snippets to personalize your email content. There’s dozens of different snippets available covering everything from personal information about a user like their name and location, their donation and action history, nearby events, and even their representatives.

You can also use conditional content to further personalize email content. For example, you could display different content based on which state a person lives in, or the value for a specific custom user field.

Merge queries give you even more power and flexibility by allowing you to personalize your mailings with ANY information in your ActionKit database. If you can retrieve it in a report, you can use it in a mailing, and that’s especially powerful when you write a report to calculate information from the database.

ONE.org put together a merge query they use in a mailing that helps them send to users in at 7PM in their local time zone if they live in the US or Canada, and 6pm GMT for the rest of the world. It also allows them to personalize their from line based on where the user lives:

select u.id as user_id, l.timezone as timezone,
CASE
WHEN u.country IN ('United States','Canada')
THEN convert_tz(timestamp(date(curdate()), maketime(19,00, 0)), coalesce('US/Eastern', "UTC"), "UTC")
ELSE timestamp(curdate(), maketime(18,00, 0))
END as send_time,
CASE
WHEN country = 'canada' THEN 'Paul Galipeau, ONE.org'
WHEN country = 'united states' THEN 'Brett Jacobson, ONE.org'
WHEN country = 'united kingdom' THEN 'Jasmine Wakeel, ONE.org'
WHEN country IN ('algeria','angola','benin','botswana','burkina faso','burundi','cameroon','cape verde','central african republic','chad','republic of the congo','democratic republic of the congo','côte d\'ivoire','djibouti','egypt','equatorial guinea','eritrea','ethiopia','gabon','gambia','ghana','guinea','guinea-bissau','kenya','lesotho','liberia','libya','madagascar','malawi','mali','mauritania','mauritius','morocco','mozambique','namibia','niger','nigeria','rwanda','sao tome and principe','senegal','seychelles','sierra leone','somalia','south africa','south sudan','sudan','swaziland','tanzania','togo','tunisia','uganda','zambia','zimbabwe','comoros','são tomé and príncipe')
THEN 'Sonia Kwami, ONE.org'
WHEN country NOT IN ('germany','france','netherlands','united states','united kingdom','canada','algeria','angola','benin','botswana','burkina faso','burundi','cameroon','cape verde','central african republic','chad','republic of the congo','democratic republic of the congo','côte d\'ivoire','djibouti','egypt','equatorial guinea','eritrea','ethiopia','gabon','gambia','ghana','guinea','guinea-bissau','kenya','lesotho','liberia','libya','madagascar','malawi','mali','mauritania','mauritius','morocco','mozambique','namibia','niger','nigeria','rwanda','sao tome and principe','senegal','seychelles','sierra leone','somalia','south africa','south sudan','sudan','swaziland','tanzania','togo','tunisia','uganda','zambia','zimbabwe')
THEN 'Caterina Scuderi, ONE.org'
ELSE 'Caterina Scuderi, ONE.org'
END as english_sender_name
from core_user u
join core_location l on (u.id = l.user_id)

Using this merge query in a mailing, campaigners can use {{ query.english_sender_name }} to insert the customized sender name. Users in the United States will get an email from “Brett Jacobson, ONE.org,” and those in the United Kingdom will get an email from “Jasmine Wakeel, ONE.org.”

That’s a fairly complicated report — but there are so many different ways to use merge queries to personalize your mailings! How have you used merge queries to personalize your mailings? Open a support ticket and let us know — we’d love to see what you’ve come up with!


Interested in scheduling a demo with ActionKit? Let us know!