Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mail.php #1175

Merged
merged 1 commit into from
Feb 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions includes/mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,14 @@ private function attachments( $template = null ) {
}
}


/**
* Replaces all mail-tags within the given text content.
*
* @param string $content Text including mail-tags.
* @param string|array $args Optional. Output options.
* @return string Result of replacement.
*/
function wpcf7_mail_replace_tags( $content, $args = '' ) {
$args = wp_parse_args( $args, array(
'html' => false,
Expand Down Expand Up @@ -356,8 +364,12 @@ function wpcf7_mail_replace_tags( $content, $args = '' ) {
return $content;
}


add_action( 'phpmailer_init', 'wpcf7_phpmailer_init', 10, 1 );

/**
* Adds custom properties to the PHPMailer object.
*/
function wpcf7_phpmailer_init( $phpmailer ) {
$custom_headers = $phpmailer->getCustomHeaders();
$phpmailer->clearCustomHeaders();
Expand All @@ -381,6 +393,10 @@ function wpcf7_phpmailer_init( $phpmailer ) {
}
}


/**
* Class that represents a single-line text including mail-tags.
*/
class WPCF7_MailTaggedText {

private $html = false;
Expand Down