当前位置: 首页>>代码示例>>Java>>正文


Java Message类代码示例

本文整理汇总了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;
}
 
开发者ID:exo-addons,项目名称:invite-friend,代码行数:25,代码来源:EmailService.java

示例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);

}
 
开发者ID:exo-addons,项目名称:marketplace-extension,代码行数:24,代码来源:AddOnService.java

示例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();
  }
}
 
开发者ID:exo-samples,项目名称:docs-samples,代码行数:14,代码来源:MailSender.java

示例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();
  }
}
 
开发者ID:exo-samples,项目名称:docs-samples,代码行数:14,代码来源:MailSender.java

示例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);

	
	
}
 
开发者ID:exo-addons,项目名称:marketplace-extension,代码行数:28,代码来源:AddOnService.java

示例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);

}
 
开发者ID:exo-addons,项目名称:marketplace-extension,代码行数:58,代码来源:AddOnService.java


注:本文中的org.exoplatform.services.mail.Message类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。