web/wp-content/plugins/caldera-forms/classes/email/sendgrid.php
/**
	 * Creates SendGrid email object
	 * 
	 * Main reason for this is to prevent adding duplicated send tos, which will cause API error.
	 * 
	 * @since 1.4.0
	 * 
	 * @param string $address Email address to send to.
	 * @param string|null $name Optional. Name of who sending to. Default is null.
	 * @param bool $prevent_double Optional. If true, prevent duplicates by returing false. Default is true.
	 *
	 * @return Email
	 */
Creates SendGrid email object

Main reason for this is to prevent adding duplicated send tos, which will cause API error.



@param string $address Email address to send to.
@param string|null $name Optional. Name of who sending to. Default is null.
@param bool $prevent_double Optional. If true, prevent duplicates by returing false. Default is true.

@return Email
Creates SendGrid email object Main reason for this is to prevent adding duplicated send tos which will cause API error . @param string $address Email address to send to . @param string|null $name Optional . Name of who sending to . Default is null . @param bool $prevent_double Optional . If true prevent duplicates by returing false . Default is true . @return Email
protected function create_email( $address, $name = null, $prevent_double = true ){
		if ( is_email( $address ) ) {
			if ( false == $prevent_double || ! in_array( $address, $this->sent_to ) ) {
				$this->sent_to[] = $address;
				return new Email( $name, $address );
			}
		}
	}
protected function create_email ( $ address , $ name = null , $ prevent_double = true ) { if ( is_email ( $ address ) ) { if ( false == $ prevent_double || ! in_array ( $ address , $ this -> sent_to ) ) { $ this -> sent_to [ ] = $ address ; return new Email ( $ name , $ address ) ; } } }
Creates SendGrid email object
Creates SendGrid email object