Developer Knowledge Level

This content is intended for WordPress developers, and it may require coding knowledge of WordPress, PHP, and JavaScript. Code examples provided here may contain errors or needs some additional coding. Make sure to test the code before using it on a live website!

This filter is run after the plugin makes the decision of adding (or not adding) email to the queue. This is the final step before the email is added (or not) to the queue. This takes into account the main add to Queue option in plugin settings and the email eligibility based on the plugin settings.

This filter provides 3 arguments.


  • $add: value can be true or false, and it is determined for each email based on the plugin settings.
  • $email: object holding the mirror of all the PHPMailer settings relevant to each email.
  • $type: email type detected by the plugin.

Email Types

Here is the list of all available email types:

Type not detected

If the type is not detected by the plugin, you can always go through the $email object filter provides and check out the subject or content to determine where it is coming from.


Here is the example that will skip the queue based on the email type.

add_filter('gdmaq_mailer_add_to_queue', 'custom__gdmaq_mailer_add_to_queue', 10, 3);
function custom__gdmaq_mailer_add_to_queue($add, $email, $type) {
  $dont_add = array('wp_password_change_notification', 'wpmu_signup_user_confirmation', 'wp_email_change_confirmation');
  if (in_array($type, $dont_add)) {
    $add = false;

  return $add;


Rate this reference

You are not allowed to rate this post.

Leave a Comment