登録プロセスには、登録プロセスの完了時にユーザーに送信および電子メールで送信する以下の機能があります。ユーザーのタイプに応じて、メールのテキストを変えてほしい。ビジネス ユーザーと個人ユーザーがいて、データベースで 1 または 0 として識別されています。
function SendBusWelcomeEmail(&$user_rec)
{
$result = mysql_query("SELECT business FROM users")
or die(mysql_error());
while ($row = mysql_fetch_array($result))
{
$actiontype = $row['business'];
switch ($actiontype)
{
case "0":
$mailer = new PHPMailer();
$mailer->CharSet = 'utf-8';
$mailer->AddAddress($user_rec['email'],$user_rec['name']);
$mailer->Subject = "Welcome to ".$this->sitename;
$mailer->From = $this->GetFromAddress();
$mailer->Body ="Hello ".$user_rec['name']."\r\n\r\n".
"Welcome! Your registration with ".$this->sitename." is completed.\r\n".
"\r\n".
"Regards,\r\n".
"Webmaster\r\n".
$this->sitename;
if(!$mailer->Send())
{
$this->HandleError("Failed sending user welcome email.");
return false;
}
return true;
break;
case "1":
$mailer = new PHPMailer();
$mailer->CharSet = 'utf-8';
$mailer->AddAddress($user_rec['email'],$user_rec['name']);
$mailer->Subject = "Welcome to ".$this->sitename;
$mailer->From = $this->GetFromAddress();
$mailer->Body ="Hello ".$user_rec['name']."\r\n\r\n".
"Welcome! thanks for your business etc etc with ".$this->sitename." is completed.\r\n".
"\r\n".
"Regards,\r\n".
"Webmaster\r\n".
$this->sitename;
if(!$mailer->Send())
{
$this->HandleError("Failed sending user welcome email.");
return false;
}
return true;
}