コード例 #1
0
ファイル: Reference.cs プロジェクト: ZhouAnPing/Mail
 /// <remarks/>
 public void createAsync(CreateDirectEmailTypeRequest createRequest, object userState) {
     if ((this.createOperationCompleted == null)) {
         this.createOperationCompleted = new System.Threading.SendOrPostCallback(this.OncreateOperationCompleted);
     }
     this.InvokeAsync("create", new object[] {
                 createRequest}, this.createOperationCompleted, userState);
 }
コード例 #2
0
        /// <summary>
        /// Create direct email type.
        /// </summary>
        /// <param name="workspaceId">workspaceId</param>
        /// <param name="emailTypeLable">emailType lable</param>
        /// <param name="emailTypeName">email type name</param>
        /// <param name="fromAddress">from address</param>
        /// <param name="senderName">sender name</param>
        /// <param name="toEmailFieldId">to email field id</param>
        /// <returns>direct email type id</returns>
        public String createDirectEmailType(String workspaceId, String emailTypeLable, String emailTypeName, String fromAddress, String senderName, String toEmailFieldId)
        {
            if (logger.IsDebugEnabled)
            {
                logger.Debug("createDirectEmailType:workspaceId=" + workspaceId + ",emailTypeLable=" + emailTypeLable + ",emailTypeName=" + emailTypeName + ",fromAddress=" + fromAddress + ",senderName=" + senderName + ",toEmailFieldId=" + toEmailFieldId);
            }

            String result;
            String emailTypeId = this.getDirectEmailTypeId(workspaceId, emailTypeName);
            //Check if the email type is already exist.
            if (!emailTypeId.Equals(""))
            {
                return emailTypeId;
            }
            cn.tripolis.dialogue.directEmailType.CreateDirectEmailTypeRequest request = new cn.tripolis.dialogue.directEmailType.CreateDirectEmailTypeRequest();
            try
            {
                request.workspaceId = workspaceId;
                request.label = emailTypeLable;
                request.name = emailTypeName;
                request.fromName = senderName;
                request.fromAddress = fromAddress;
                request.toEmailFieldId = toEmailFieldId;//"MTExMzYxMTEfCGWCBaFKyA"
                request.enableWysiwygEditor = true;

                request.encoding = cn.tripolis.dialogue.directEmailType.characterEncoding.UTF8;

                cn.tripolis.dialogue.directEmailType.IDResponse response = directEmailTypeService.create(request);

                result = response.id;


            }
            catch (System.Web.Services.Protocols.SoapException ex)
            {
                if (!Util.isCodeExist(ex.Detail) || Util.getExistId(ex.Detail).Equals(""))
                {
                    result = ex.Detail.InnerXml;
                    if (logger.IsDebugEnabled)
                    {
                        logger.Debug("error happens in create direct email type, error is" + result);
                    }
                    throw new Exception(ex.Detail.InnerXml);
                }
                result = Util.getExistId(ex.Detail);

            }
            return result;
        }
コード例 #3
0
ファイル: Reference.cs プロジェクト: ZhouAnPing/Mail
 /// <remarks/>
 public void createAsync(CreateDirectEmailTypeRequest createRequest) {
     this.createAsync(createRequest, null);
 }