本文整理汇总了Java中org.exoplatform.services.mail.Message类的典型用法代码示例。如果您正苦于以下问题:Java Message类的具体用法?Java Message怎么用?Java Message使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Message类属于org.exoplatform.services.mail包,在下文中一共展示了Message类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendInvitation
import org.exoplatform.services.mail.Message; //导入依赖的package包/类
public Boolean sendInvitation(String inviter,String invitee_email, String invitationUrl){
Identity identity = identityManager.getOrCreateIdentity(OrganizationIdentityProvider.NAME,inviter,true);
if (null != identity && null != identity.getProfile()){
Profile profileInviter = identity.getProfile();
String sender = profileInviter.getFullName()+" | "+this.getDNS()+"<"+profileInviter.getEmail()+">";
String subject = this.generateSubject(identity);
String body = this.generateBody(identity,invitationUrl) ;
if (null != body){
try {
Message message = new Message();
message.setFrom(sender);
message.setTo(invitee_email);
message.setSubject(subject);
message.setBody(body);
message.setMimeType("text/html");
exoMailService.sendMessage(message);
} catch (Exception e) {
log.error("exo invite friend => cannot send invitation "+e.getMessage());
return false;
}
}
}
return true;
}
示例2: sendRequestReceiveMail
import org.exoplatform.services.mail.Message; //导入依赖的package包/类
/**
*
*/
public static void sendRequestReceiveMail(String receiver, String fromEmail, String hostName)
throws Exception {
MailService mailService = WCMCoreUtils.getService(MailService.class);
Message message = new Message();
message.setTo(receiver);
message.setFrom("eXo Resource Center" + "<" +fromEmail + ">");
String bodyMessage = "<br> Thank you for submitting your add-on." + "<br>"
+ "<br>"
+ "=========================" + "<br>"
+ hostName;
message.setBody(bodyMessage);
message.setMimeType("text/html");
message.setSubject("Thank you for submitting your Add-on");
mailService.sendMessage(message);
}
示例3: sendCustomers
import org.exoplatform.services.mail.Message; //导入依赖的package包/类
public void sendCustomers() {
Message message = new Message();
message.setSubject(subject);
message.setBody(body);
message.setFrom(userBean.getUserEmail());
message.setTo(customerMailList.getMailList());
try {
((MailService) CommonsUtils.getService(MailService.class)).sendMessage(message);
} catch (Exception e) {
e.printStackTrace();
}
}
示例4: sendPartners
import org.exoplatform.services.mail.Message; //导入依赖的package包/类
public void sendPartners() {
Message message = new Message();
message.setSubject(subject);
message.setBody(body);
message.setFrom(userBean.getUserEmail());
message.setTo(partnerMailList.getMailList());
try {
((MailService) CommonsUtils.getService(MailService.class)).sendMessage(message);
} catch (Exception e) {
e.printStackTrace();
}
}
示例5: SendConfirmationAddonPublishedEmail
import org.exoplatform.services.mail.Message; //导入依赖的package包/类
public static void SendConfirmationAddonPublishedEmail(String receiver,String nodeName, String hostName) throws Exception{
String fromEmail = Utils.getPortletPreference(PREFERENCE_FROM);
String fromName = Utils.getPortletPreference(PREFERENCE_FROM_NAME);
String itemPath = Utils.getPortletPreference(PREFERENCE_ITEM_PATH);
String[] strs = itemPath.split("/");
String folder = strs[strs.length-2];
MailService mailService = WCMCoreUtils.getService(MailService.class);
Message message = new Message();
String link = hostName + "/portal/intranet/addon-detail?content-id=/repository/collaboration/sites/intranet/web contents/Contributions/" + nodeName;
message.setTo(receiver);
message.setFrom(fromName + "<" +fromEmail + ">");
String bodymess = "Thank your for contributing to the eXo Add-ons, your add-on has been validated and published." + "<br>"
+ "Please access you add-on here: " + "<a href='link' >" + link + "</a>" + "<br><br>"
+ "=========================" + "<br>"
+ hostName;
message.setBody(bodymess);
message.setMimeType("text/html");
message.setSubject("Your Add-on has been validated and published on " + hostName);
mailService.sendMessage(message);
}
示例6: sendNewAddonSubmisson
import org.exoplatform.services.mail.Message; //导入依赖的package包/类
public static void sendNewAddonSubmisson(String receiver, String fromEmail, String subject,
String email, String titleAddon, String description,
String version,String license, String author,
String compatibility,String sourceUrl,
String documentUrl ,String downloadUrl , String codeUrl,
String demoUrl, String installCommand, Boolean hosted,
String hostName)
throws Exception {
MailService mailService = WCMCoreUtils.getService(MailService.class);
Message message = new Message();
message.setTo(receiver);
message.setFrom("eXo Resource Center" + "<" +fromEmail + ">");
String _version = version!= null ? "Version: " + version : "Version: ";
String _license = license!= null ? "License: " + license : "License: ";
String _author = author!= null ? "Author: " + author : "Author: ";
String _compatibility = compatibility!= null ? "Compatibility: " + compatibility : "Compatibility: ";
String _sourceUrl = sourceUrl!= null ? "Source Code: " + sourceUrl : "Source Code: ";
String _documentUrl= documentUrl!= null ? "Documentation: " + documentUrl : "Documentation: ";
String _downloadUrl= downloadUrl!= null ? "Download: " + downloadUrl : "Download: ";
String _codeUrl= codeUrl!= null ? "Code URL: " + codeUrl : "Code URL: ";
String _demoUrl= demoUrl!= null ? "Demo URL: " + demoUrl : "Demo URL: ";
String _installCommand= installCommand!= null ? "Install command: " + installCommand : "Install command: ";
String _hosted= hosted ? "I wish my add-on to be hosted on the eXo Add-on repository on Github: Yes" : "I wish my add-on to be hosted on the eXo Add-on repository on Github: No";
String bodyMessage = "The following add-on is submitted on " + hostName + "<br><br>"
+ "Add-on Name: " + titleAddon + "<br><br>"
+ "Description: " + description + "<br><br>"
+ _version + "<br><br>"
+ _license + "<br><br>"
+ _compatibility + "<br><br>"
+ _sourceUrl + "<br><br>"
+ _documentUrl + "<br><br>"
+ _downloadUrl + "<br><br>"
+ _codeUrl + "<br><br>"
+ _demoUrl + "<br><br>"
+ _installCommand + "<br><br>"
+ _hosted + "<br><br>"
+ _author + "<br><br>"
+ "Email (for internal use only): " + email + "<br><br>"
+ "Please login to the website back-end to validate or refuse the add-on. (go to \"Web contents\" folder > \"Contributions\" folder, add categories and publish. " + "<br><br>"
+ "=========================" + "<br>"
+ hostName;
message.setBody(bodyMessage);
message.setMimeType("text/html");
message.setSubject(subject);
mailService.sendMessage(message);
}