The following is a list of shortcodes that may be used in the email messages. Note: some shortcodes are only available in the admin message, and it is up to you to make sure that proper information is sent (i.e. if you remove [password] from the registration email, the user will not receive a password and thus not be able to login). The plugin installs with defaults for each of these messages to provide you with an example of what is available.
- [blogname] – the Site Title you have specified under Settings > General
- [email] – the email address the user registered with
- [reglink] – a link to the page the user registered on (useful to return a user directly to the content they registered to view)
- [user-profile] – a link to the user profile where the user can update their password or registration information
- [exp-type] – expiration type (subscription/trial) [available only if the PayPal Subscription Module is used]
- [exp-date] – the expiration date [available only if the PayPal Subscription Module is used]
- [login] – link to the login page if a login page is defined in the plugin’s main settings
- [register] – link to the registration page if a registration page is defined in the plugin’s main settings
- Additionally, any custom field is available based on the field’s option name/meta key found in the Fields tab (excludes “user_login” and “user_email”)
- [fields] – admin notification only – a list of any of the registration fields
- [user-ip] – admin notification only – the user’s IP address when they registered
- [activate-user] – admin notification only – a link to the user profile page so they can be activated (used if moderating registration)
Any field option name can be used as an email shortcode in both emails to users and admins. So if you have a custom field with the option name “my_field” you can use this in the email as [my_field].
If you have a need for a custom shortcode beyond this, custom shortcodes can be added with the wpmem_email_shortcodes filter.
Some important things to consider:
The plugin installs with certain default settings and email content. Based on your chosen way of using the plugin, you may need to alter the email content to make sense. Here are some important considerations.
- You are not required to use any of the shortcodes (although note #2 below about passwords). If you want to hardcode a link to something in the email content, that is perfectly fine. The shortcodes are just a helper for some of these items. The default example emails are just examples. Just because something is in the example doesn’t mean you have to use it. If you don’t like the example, change it.
- If you have added a password field to the registration process AND you have set the plugin to moderate registrations for admin approval, you cannot send the password in the “user is approved” email. If you intend to email a copy of the user’s login credentials in this configuration, you MUST do it in the initial welcome email. That means you will need to make some changes to the fields that are included in the default emails.
- The User Profile link is included in the initial email. However, this is assuming that you have set up a user profile page using the user profile shortcode and have noted the URL location of this page in the plugin’s settings. If you have not done that, this field will be blank in the message to the user.
- The admin notification email by default includes an example of the activation link shortcode. This does not mean that moderated registration is turned on. If you use moderated registration you will want this link, but if you do not, feel free to just take it out (unless you would like to have a link to the user profile included in the admin notification email).
If you have additional dynamic content from outside the plugin that needs to be included in your email to a user, there are filters available for this.