shortcode for first name when using automessage plugin

Hey,

I'm looking at using this plugin to replace Mailchimp as an auto-responder, but I have a couple questions:

1. How can I use someone's first name (not user name) with a shortcode? I tried the %usernicename% but it just gave me the user name still.

2. How do I specify what email address this is sent from?

3. How do I create customized actions? For example, I'd like different auto-responders to trigger depending on which subscription a user chooses via the Memberships plugin. Is this possible?

4. Is there anywhere to view the queue and/or past messages sent and/or open rates?

Thanks so much!

  • Michael Bissett

    Hey @Dave, hope you're doing well today. :slight_smile:

    1. This would require a custom shortcode to be made, since this isn't available out of the box. In automessage\classes\class.user.php, you can look at lines 46-58 to see what's there right now (for a user).

    This is outside of my present knowledge, so I've called my colleague @Ashok here for his input on the matter.

    2. You can use something like WP SMTP to change the address that it's sent from:

    http://wordpress.org/plugins/wp-smtp/

    3. Actually, you wouldn't need Automessage for this, as Membership already has it's own auto-responder that it uses (and, it allows for choosing which subscription gets what message).

    4. You can see how big the queue is for each message, but it doesn't have the ability to show open rates or a list of passages.

    Let me know if you need further assistance here! :slight_smile:

    Regards,
    Michael

  • Ash

    Hi @Dave

    To add first name, you need to edit the plugin. Please go to automessage\classes\class.user.php line no 46 to 58 and replace

    if(function_exists('get_blog_option')) {
    					$replacements = array(	"/%blogname%/" 	=> 	get_blog_option( $blog_id,'blogname'),
    											"/%blogurl%/"	=>	untrailingslashit(get_blog_option( $blog_id,'home')),
    											"/%username%/"	=>	$this->user_login,
    											"/%usernicename%/"	=>	$this->user_nicename
    										);
    				} else {
    					$replacements = array(	"/%blogname%/" 	=> 	get_option('blogname'),
    											"/%blogurl%/"	=>	untrailingslashit(get_option('home')),
    											"/%username%/"	=>	$this->user_login,
    											"/%usernicename%/"	=>	$this->user_nicename
    										);
    				}

    with this:

    if(function_exists('get_blog_option')) {
    					$replacements = array(	"/%blogname%/" 	=> 	get_blog_option( $blog_id,'blogname'),
    											"/%blogurl%/"	=>	untrailingslashit(get_blog_option( $blog_id,'home')),
    											"/%username%/"	=>	$this->user_login,
    											"/%usernicename%/"	=>	$this->user_nicename,
    											"/%firstname%/"	=>	$this->user_firstname
    										);
    				} else {
    					$replacements = array(	"/%blogname%/" 	=> 	get_option('blogname'),
    											"/%blogurl%/"	=>	untrailingslashit(get_option('home')),
    											"/%username%/"	=>	$this->user_login,
    											"/%usernicename%/"	=>	$this->user_nicename,
    											"/%firstname%/"	=>	$this->user_firstname
    										);
    				}

    Then you can use %firstname% for first name.

    About the membership issue (though it's a different issue, would be better if you create a new thread :slight_smile: ), yes it offers for new subscribers.

    Hope it helps :slight_smile: Please feel free to ask more question if you have.

    Cheers
    Ash

  • Don

    Hi @Ash,

    Thanks for a great plugin!

    I'm going to use Automessage and I also will edit the code as you have shown. I want to know if once I make the edit, will the edit remain intact after future upgrades or will you add /%firstname%/ to an upgrade? Obviously, once I do this and forget about it, I don't want subscribers on my site to be getting an auto message addressed like: "Hi ," etc.

    Also, how would I edit the code to show the new first name shortcode on the Add Action form where the other shortcodes are listed, after: "You can use the following constants within the message body to embed database information."

    Thanks!
    Don

  • Vinod Dalvi

    Hi Don,

    I hope you are well today.

    Ideally its not a good process to post on a thread a year old. If you create a new topic for your question here https://premium.wpmudev.org/forums/#question then you will get reply sooner.

    You can also include reference of old thread like this in your newly created thread if you want to.

    I'm going to use Automessage and I also will edit the code as you have shown. I want to know if once I make the edit, will the edit remain intact after future upgrades or will you add /%firstname%/ to an upgrade?

    You have to make these changes again after plugin updation as changes made in the plugin file get lost on plugin updation.

    Instead of editing the code in the plugin file you can change it by using the filter automessage_replacements declared in the same plugin file and developing custom code in the function called by this filter.

    Thanks,
    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.