Warning: This method has been deprecated. LLMS_Engagements::handle_email is deprecated in favor of LLMS_Engagement_Handler::handle_email instead.

LLMS_Engagements::handle_email( mixed[] $args )

Send an email engagement


Description Description

This is called via do_action() by the ‘maybe_trigger_engagement’ function in this class.


Top ↑

Parameters Parameters

$args

(mixed[]) (Required) An array of arguments from the triggering hook.

  • (int) WP_User ID.
  • '1'
    (int) WP_Post ID of the email.
  • '2'
    (int|string) WP_Post ID of the related triggering post or an empty string for engagements with no related post.
  • '3'
    (int) WP_Post ID of the engagement post.


Top ↑

Return Return

(bool|WP_Error) Returns true on success, false when the email is skipped, and a WP_Error when the email has failed or is prevented.


Top ↑

Source Source

File: includes/class.llms.engagements.php

	public function handle_email( $args ) {
		_deprecated_function( 'LLMS_Engagements::handle_email', '6.0.0', 'LLMS_Engagement_Handler::handle_email' );
		$res = LLMS_Engagement_Handler::handle_email( $args );
		if ( true === $res ) {
			return $res;
		}
		// The new handler returns an array of errors in favor of a single error. Retain the initial return type for this deprecated version.
		return $res[0];
	}


Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 LLMS_Engagements::handle_email is deprecated in favor of LLMS_Engagement_Handler::handle_email.
4.4.3 Fixed different emails triggered by the same related post not sent because of a wrong duplicate check. Fixed dupcheck log message and error message which reversed the email and person order.
4.4.1 Use postmeta helpers for dupcheck and postmeta insertion. Add a return value in favor of void. Log successes and failures to the engagement-emails log file instead of the main llms log.
3.8.0 Unknown.
2.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.