IBM eCommerce中Send Email的不同方式
IBM eCommerce中发送邮件很简单。
SendMsgCmd cmdSendMsg = (SendMsgCmd) CommandFactory.createCommand(SendMsgCmd.NAME, storeId);
cmdSendMsg.setConfigData("subject", "User Registration Notify");
cmdSendMsg.setStoreID(storeId);
CommandContext ctx = RemoteServiceUtil.getCommandContext(storeId, "-1000");
ctx.setRequestProperties(requestProperties);
cmdSendMsg.compose(null, ctx, requestProperties);
cmdSendMsg.setMsgType("RegistrationNotify");
String email = requestProperties.getString("logonId");
cmdSendMsg.sendTransacted();
//cmdSendMsg.sendImmediate();
cmdSendMsg.setCommandContext(ctx);
cmdSendMsg.execute();
不过需要注意的是,SendMsgCmd对于待发送的邮件有两种处理方式:
cmdSendMsg.sendTransacted();
cmdSendMsg.sendImmediate();
第一种先缓存在Database中,再Scheduler定期发送;
另一种立即发送;
浙公网安备 33010602011771号