コード例 #1
0
void WsNewsLetter::sendConfirmMail(const std::string& email,
                                       const std::string& userToken) const
{
  std::string url = "/newsletter/subscribe/";
  WApplication *app = WApplication::instance();
  url = app->makeAbsoluteUrl(app->bookmarkUrl(url)) + userToken;

  Mail::Message message;

  message.addRecipient(Mail::To, Mail::Mailbox(email));
  message.setSubject(WString::tr("subject"));
  message.setBody(WString::tr("body").arg(email).arg(url));
  message.addHtmlBody(WString::tr("htmlbody").arg(email).arg(url));

  sendMail(message);
}
コード例 #2
0
ファイル: AuthService.C プロジェクト: ansons/wt
void AuthService::sendLostPasswordMail(const std::string& address,
                                       const User& user,
                                       const std::string& token) const
{
    Mail::Message message;

    std::string url = createRedirectUrl(token);

    message.addRecipient(Mail::To, Mail::Mailbox(address));
    message.setSubject(WString::tr("Wt.Auth.lostpasswordmail.subject"));
    message.setBody(WString::tr("Wt.Auth.lostpasswordmail.body")
                    .arg(user.identity(Identity::LoginName))
                    .arg(token).arg(url));
    message.addHtmlBody(WString::tr("Wt.Auth.lostpasswordmail.htmlbody")
                        .arg(user.identity(Identity::LoginName))
                        .arg(token).arg(url));

    sendMail(message);
}
コード例 #3
0
ファイル: AuthService.C プロジェクト: bvanhauwaert/wt
void AuthService::sendConfirmMail(const std::string& address,
			       const User& user, const std::string& token) const
{
  Mail::Message message;

  WApplication *app = WApplication::instance();
  std::string url
    = app->makeAbsoluteUrl(app->bookmarkUrl(redirectInternalPath_)) + token ;

  message.addRecipient(Mail::To, Mail::Mailbox(address));
  message.setSubject(WString::tr("Wt.Auth.confirmmail.subject"));
  message.setBody(WString::tr("Wt.Auth.confirmmail.body")
		  .arg(user.identity(Identity::LoginName))
		  .arg(token).arg(url));
  message.addHtmlBody(WString::tr("Wt.Auth.confirmmail.htmlbody")
		      .arg(user.identity(Identity::LoginName))
		      .arg(token).arg(url));

  sendMail(message);
}