Skip to content

Mailer component and html() call -incompatible with simple_html_dom library ? #54733

Answered by simogeo
simogeo asked this question in Q&A
Discussion options

You must be logged in to vote

For your information, a workaround is to cast variable to string

This generates an error :

$message = (new Email())
				->from(new Address($from, $fromname))
				->subject($email['subject'])
				->text($email['txt_body'])
				->html($email['html_body']);

and this works :

$message = (new Email())
				->from(new Address($from, $fromname))
				->subject($email['subject'])
				->text($email['txt_body'])
				->html((string) $email['html_body']);

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by simogeo
Comment options

You must be logged in to vote
1 reply
@mbabker
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants
Converted from issue

This discussion was converted from issue #54732 on April 25, 2024 16:58.