YayMail WooCommerce Email Customizer Shortcode

Below, you’ll find a detailed guide on how to add the YayMail – WooCommerce Email Customizer Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the YayMail – WooCommerce Email Customizer Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the YayMail – WooCommerce Email Customizer Plugin and the shortcodes it provides:

Plugin Icon
YayMail – WooCommerce Email Customizer

"YayMail – WooCommerce Email Customizer is a powerful plugin that enhances your email marketing by allowing you to personalize and tailor WooCommerce emails to your liking."

★★★★☆ (173) Active Installs: 30000+ Tested with: 6.3.2 PHP Version: 7.2
Included Shortcodes:
  • [yaymail_shortcode_name]

YayMail – WooCommerce Email Customizer [yaymail_shortcode_name] Shortcode

The ‘yaymail’ shortcode is a dynamic function in the YayMail plugin that calls back specific order data. This shortcode, when used, checks if the order data associated with the given tag exists. If it does, it returns that data; otherwise, it returns false. It’s a handy tool for customizing email templates in WooCommerce.

Shortcode: [yaymail_shortcode_name]

Examples and Usage

Basic example – A simple shortcode that fetches order data based on the provided tag name.

[yaymail_order_data tag="order_id" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [yaymail_shortcode_name] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'yaymail_' . $shortcode_name, array( $this, 'shortcodeCallBack' ) );

Shortcode PHP function:

function shortcodeCallBack( $atts, $content, $tag ) {

		return isset( $this->order_data[ '[' . $tag . ']' ] ) ? $this->order_data[ '[' . $tag . ']' ] : false;

	}

Code file location:

yaymail/yaymail/includes/MailBuilder/Shortcodes.php

Conclusion

Now that you’ve learned how to embed the YayMail – WooCommerce Email Customizer Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *