1
jorgelongolo
XoopsMailer and Reply-to is possible????

Hi,

I was reading the development site the xoopsmailer

but i cant find how can i add "Reply-To"
Can somebody help me?

Thanks

Quote:

Xoops Mailer

This class is sometimes overlooked or not used my module developers, here is an example using a template rather than enter the content of the email with the PHP Code. This keeps the whole process cleaner and easir to manage.

I think it would be an excellent feature to allow webmasters access via the module to edit these templates in future. thus giving them more control over the email content.
Needed include for emailer

include XOOPS_ROOT_PATH."/class/xoopsmailer.php";
Set up the email class

$xoopsMailer =& getMailer();
$xoopsMailer->useMail();

Sets the template directory, in this example we are using the language directory. This can be useful if we need the email in more than one language.

$xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH.'/modules/wfchannel/language/'.$xoopsConfig['language'].'/mail_template');

Sets the file to be used for this email

$xoopsMailer->setTemplate("refer.tpl");

Now we setup needed vars for this email
Email address we will be sending too

$xoopsMailer->setToEmails($remail);

Email address and uname sending from

$xoopsMailer->setFromEmail($semail);
$xoopsMailer->setFromName($sname);

This is the email subject line

$xoopsMailer->setSubject($subject);

Use can assign other information to be used within the body of the email if you wish

$xoopsMailer->assign("MESSAGE", $message);
$xoopsMailer->assign("SITENAME", $xoopsConfig['sitename']);
$xoopsMailer->assign("SITEURL", XOOPS_URL."/");
$xoopsMailer->assign("TITLE", _MD_MESSAGETITLE);

Send the email, without verifying

$xoopsMailer->send();

or, with verifying

if ( !$xoopsMailer->send() ) {
'print error and return'
} else {
//do something else to indicate success
}

Example email template

Hello.

You have received one request to become partner of your site {SITENAME}
The request was sent by the user {USER} from the IP {IP}
The information you provide us in the join form was:

Títle: {TITLE}
URL: {URL}
Image: {IMAGE}
Description:
{DESCRIPTION}

Can add this request from this url:
{SITEURL}modules/xoopspartners/admin/index.php?op=partners_manage_add

{SITENAME} ({SITEURL})

Catzwolf

Login

Who's Online

396 user(s) are online (264 user(s) are browsing Support Forums)


Members: 0


Guests: 396


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits