Welcome,
Guest
.
Please
login
or
register
.
Did you miss your
activation email
?
News:
EDC:
Download extensions for Elxis CMS
.
Home
Help
Login
Register
Elxis CMS Forum
»
Support
»
Technical support
»
Can elxis send html emails?
« previous
next »
Print
Pages: [
1
]
Author
Topic: Can elxis send html emails? (Read 8231 times)
michalis1984
Sr. Member
Posts: 334
Can elxis send html emails?
«
on:
May 02, 2020, 11:58:50 »
Hello,
Can I use elxis sendmail function to send HTML emails? And if yes how?
Logged
Blacksoll
Full Member
Posts: 111
Re: Can elxis send html emails?
«
Reply #1 on:
May 04, 2020, 13:16:36 »
With newsletter module it can!
https://www.elxis.net/edc/communication/61.html
Logged
michalis1984
Sr. Member
Posts: 334
Re: Can elxis send html emails?
«
Reply #2 on:
May 04, 2020, 14:40:45 »
I was looking for the class but i find it
Code:
[Select]
$elxis->sendmail($subject, $body, '', null, 'html', $to, null, null, $from, 3, false, $replyto);
Logged
datahell
Elxis Team
Hero Member
Posts: 10356
Re: Can elxis send html emails?
«
Reply #3 on:
May 04, 2020, 22:44:54 »
Elxis can send any type of email you want. Plain text, html, both plain/html, with attachments, mass mail, and more.
You found the correct function, I type it once more for clarification:
sendmail($subject, $body, $alt_body='', $attachment=null, $type='plain', $to=null, $cc=null, $bcc=null, $from=null, $priority=3, $debug=false, $replyto=null)
So, to send html email:
$elxis->sendmail('My subject', $html_text, $optional_plain_text, null, 'html', 'test@example.com');
Tip
: The additional plain text message is used when the email client doesn't want or doesn't support html emails. So in this case he will see the plain text message instead. If you ommit it he will see the html one without the html format which most probably will look ugly. So it is a good practice to include an alternative plain text message when sending html emails.
Ask you have any questions regarding the function parameters.
«
Last Edit: May 04, 2020, 22:47:34 by datahell
»
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
michalis1984
Sr. Member
Posts: 334
Re: Can elxis send html emails?
«
Reply #4 on:
May 05, 2020, 02:46:37 »
Thank you datahell! The tip is very useful.
I want to learn more about the $attachment parameter.
What if I want to attach an image or a pdf file at the email (which is already uploaded)? How do I use that parameter? Full URL or any special elxis internal link?
Logged
datahell
Elxis Team
Hero Member
Posts: 10356
Re: Can elxis send html emails?
«
Reply #5 on:
May 05, 2020, 08:45:14 »
To attach a file you use the ABSOLUTE PATH to the file, not a url. You can use the ELXIS_PATH constant which is the absolute path to elxis installation folder without trailing slash.
$file = ELXIS_PATH.'/something/test.pdf';
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
datahell
Elxis Team
Hero Member
Posts: 10356
Re: Can elxis send html emails?
«
Reply #6 on:
May 05, 2020, 08:48:38 »
Full documentation in elxis docs:
https://www.elxis.net/docs/developers/tutorials/sending-emails.html
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
michalis1984
Sr. Member
Posts: 334
Re: Can elxis send html emails?
«
Reply #7 on:
May 05, 2020, 18:08:38 »
Thank you again datahell!
Too bad of me I didn't notice the post at the elxis docs. It's there since 2012
Logged
Print
Pages: [
1
]
« previous
next »
Elxis CMS Forum
»
Support
»
Technical support
»
Can elxis send html emails?