Mailin Shortcode

Below, you’ll find a detailed guide on how to add the Mailin 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 Mailin Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the Mailin Plugin and the shortcodes it provides:

Plugin Icon
Newsletter, SMTP, Email marketing and Subscribe forms by Brevo (formely Sendinblue)

"Newsletter, SMTP, Email marketing and Subscribe forms by Brevo (formerly Sendinblue) is a WordPress plugin that enhances your email marketing capabilities. It provides seamless SMTP integration and customizable subscription forms."

★★★★✩ (232) Active Installs: 100000+ Tested with: 6.3.2 PHP Version: 5.6
Included Shortcodes:
  • [sibwp_form]

Mailin [sibwp_form] Shortcode

The Sendinblue WordPress Plugin shortcode is a powerful tool that generates a specific form based on the ID provided. It retrieves the form ID from the shortcode attributes and generates the form in the desired language. If no language is defined, it defaults to the site’s language. The form is then outputted wherever the shortcode is placed.

Shortcode: [sibwp_form]

Parameters

Here is a list of all possible sibwp_form shortcode parameters and attributes:

  • id – Unique identifier for the specific contact form.

Examples and Usage

Basic example – A shortcode that will render a form with the ID ‘oldForm’.

[sibwp_form id='oldForm' /]

Advanced examples

Example of a shortcode that will render a form with the ID ‘contactUs’. If ‘contactUs’ form is not found, it will return the ‘oldForm’.

[sibwp_form id='contactUs' /]

Example of a shortcode that will render a form with the ID ‘subscribe’. If ‘subscribe’ form is not found, it will return the ‘oldForm’. It also uses a language code ‘fr’ (French) to display the form in French.

[sibwp_form id='subscribe' lang='fr' /]

These examples illustrate how you can use different parameters with the ‘sibwp_form’ shortcode to display different forms and in different languages on your WordPress website.

PHP Function Code

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

Shortcode line:

add_shortcode( 'sibwp_form', array( &$this, 'sibwp_form_shortcode' ) );

Shortcode PHP function:

function sibwp_form_shortcode( $atts ) {
			$pull_atts = shortcode_atts(
				array(
					'id' => 'oldForm', // We will return 'oldForm' for shortcode of old form.
				), $atts
			);
			$frmID = $pull_atts['id'];
			$lang = defined( 'ICL_LANGUAGE_CODE' ) ? ICL_LANGUAGE_CODE : '';

			ob_start();
			$this->generate_form_box( $frmID, $lang );

			$output_string = ob_get_contents();
			ob_end_clean();
			return $output_string;
		}

Code file location:

mailin/mailin/sendinblue.php

Conclusion

Now that you’ve learned how to embed the Mailin 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 *