Personalize your newsletters with first name and other shortcodes
This article refers to MailPoet 2
If you're looking for MailPoet 3 articles, please go to MailPoet 3 Knowledge Base
You can personalize your newsletters by including the first and/or last name of your subscribers.
This works in 3 different places:
- The Subject line of your newsletter
- In the newsletter editor (Step 2)
- In the Confirmation email (Settings page, Subscription Confirmation tab)
How it works in the visual editor
To add a first name, last name or a default text, use the following button in your text editor:
This will add this snippet (or "tag") in your text editor:
[user:firstname | user:lastname | default:subscriber]
This code means: put the first name. If the subscriber doesn't have a first name, put the last name. If the user doesn't have either, insert "subscriber".
If your first name is John Doe in your subscriber profile in MailPoet, and you send the newsletter to yourself, you will see this: Howdy John, how are you today?
If the subscriber doesn't have a first name, this will show instead: Howdy Doe, how are you today?
Finally, if the subscriber only has an email address, it will show this: Howdy subscriber, how are you today?
Send yourself a test newsletter to try it.
Other examples of usageIf you want just the first name, use this:
Howdy [user:firstname | default:subscriber], how are you today?Alternatively, just the last name, like this:
[user:lastname | default:subscriber]And the full name, which is tricky because you have to be creative for email-only subscribers:
Hello [user:firstname | default:Comrade] [user:lastname | default:of our ship]!
This would display one of these 3 combinations if the recipient is called John Doe:
- Hello John Doe!
- Hello Comrade Doe!
- Hello Comrade of our ship!
Full list of available shortcodes
- First Name: [user:firstname | default:subscriber]
- Last Name: [user:lastname | default:subscriber]
- Email Address: [user:email]
- Wordpress user display name: [user:displayname | default:subscriber]
- User count: [user:count]
- Newsletter Subject: [newsletter:subject]
- Show number of posts: [newsletter:total]
- Show latest post's title: [newsletter:post_title]
- Display the issue number: [newsletter:number]
- Current day of the month number: [date:d]
- Current day of the month in ordinal, ie. 2nd, 3rd, etc : [date:dordinal]
- Full name of current day: [date:dtext]
- Current month number: [date:m]
- Full name of current month: [date:mtext]
- Year: [date:y]
- Unsubscribe link: [global:unsubscribe]
- Edit subscription page link: [global:manage]
Your own custom shortcode: read this article for more information on adding your own shortcodes.
Other Shortcodes Available
If you want to show your total number of subscribers in your theme's sidebar, you should install this plugin: ShortCode WidgetThis plugin will add a new widget called ShortCode Widget, inside your Appearance menu > Widgets page. Only then you can use insert this shortcode:
You can also select the Subscribers Lists that will be counted toward the total on your MailPoet Setting's page > Advanced tab > Geeky options link: