WPNewsman

Use of Short Codes in Emails

In WPNewsman you can use numerous short codes to merge different information into your email newsletters. When you add custom fields and/or options to the subscription form, WPNewsman instantly displays the short code for the selected field. You can copy the shortcode and insert it into the email message or template to personalize your newsletters or confirmation/welcome message.

copy shortcode in the optin form

In addition to custom short codes, you can use the short codes below:

[newsman sub="*"] outputs all fields of the subscriber. Should only be used in admin notification emails.

[newsman sub="*" tag="li"] the same as above but additionally wraps each field-value pair in the specified html element.

[newsman wp="blogname"] outputs the results of the wp function call get_option(‘blogname’)

[newsman wp='url'] outputs the results of the wp function call get_bloginfo(‘url’)

[newsman wp='wpurl'] outputs the results of the wp function call get_bloginfo(‘wpurl’)

[newsman wp="blogdescription"] outputs the results of the wp function call get_option(‘blogdescription’)

[newsman me="email"] outputs “From email” plugin settings value

[newsman me="name"] outputs “From name” plugin settings value

[newsman link='confirmation'] outputs the subscription confirmation URL

[newsman link='resend-confirmation'] outputs the resend confirmation URL

[newsman link='unsubscribe'] outputs the instant unsubscribe URL

[newsman link='confirm-unsubscribe'] outputs the unsubscription confirmation URL

[newsman-form id="1"] outputs subscription form. id is the id of the list.

[newsman date="Y-m-d"] outputs current date in the specified format (see http://php.net/manual/en/function.date.php for formatting options)

[newsman sub='subscribed'] outputs the subscription date

[newsman subject] outputs the email subject

[newsman fn=] works with any WordPress function. For example, the shortcode to output the post author’s name will be [newsman fn=’the_author’]

Pair (opening and closing) short codes:

[newsman_in_email]

[/newsman_in_email] text inside these short codes is visible in the email client only

[newsman_not_on_web]

[/newsman_not_on_web] text inside these short codes is visible in the email client only

[newsman_on_web]

[/newsman_on_web] text inside these short codes is visible on the web only

[newsman_has_thumbnail]

[/newsman_has_thumbnail] used in the post template only, the block is visible only if the post has a thumbnail

[newsman_no_thumbnail]

[/newsman_no_thumbnail] used in the post template only, the block is visible only if the post has no thumbnail

[newsman fn=] works with any WordPress function. For example, the shortcode to output the post author’s name will be [newsman fn=’the_author’]

We suggest to use pair short codes in comments <!– –> in order they are not displayed in the message:

<!-- [newsman_in_email] -->

<!-- [/newsman_in_email] -->

Short codes that can be used inside the “post_block” editable block of digest particles file:

[newsman post="number" outputs the number of post in the batch

[newsman post='permalink']

[newsman post="fancy_excerpt"]

[newsman post="post_date"]

[newsman post="post_title"]

[newsman post="post_content"] outputs the full post content

[newsman post="post_excerpt"] outputs the original post excerpt filled in the WordPress post’s excerpt field on the post editing page.

[newsman post="fancy_excerpt" words="150"] outputs the post excerpt created from the post content. Words – maximum number of words.

[newsman post="thumbnail"] outputs the thumbnail URL

[newsman_loop query="tag=bread,baking"] fetches the posts with standard wp query in string notation (see more here http://codex.wordpress.org/Class_Reference/WP_Query).

Also you can pass parameters to the WP_Query constructor as object, just put the shortcode as parameters, for example:

[newsman_loop tag="bread" posts_per_page="5" nopaging="1" orderby="date" order="DESC"] returns 5 latest posts with the tag “bread”

[newsman_loop post__in="1,2,3"] fetches all posts from the set

[newsman_loop post__not_in="1,2,3"] fetches all posts except those listed in the set

Short Codes for Social Profiles Links

These short codes work if your enter the URLs of your social profiles in the plugin Settings:

[newsman profileurl='twitter'] fetches the URL of your Twitter profile

[newsman profileurl='googleplus'] fetches the URL of your Google+ profile

[newsman profileurl='linkedin'] fetches the URL of your LinkedIn profile

[newsman profileurl='facebook'] fetches the URL of your Facebook profile