Exemple #1
0
        public String publishingBulkEmail(String apiKey, String contactfileName, String fromName, String fromAddress, String subject, String reportReceiveAddress, String mailBody)
        {
            DialogueSettingDao DialogueSettingDao = new DialogueSettingDao();
            DialogueSettingBO DB_DialogueSetting = DialogueSettingDao.Get(apiKey);

            Authorization authorization = new Authorization();
            authorization.client = DB_DialogueSetting.client;
            authorization.username = DB_DialogueSetting.username;
            authorization.password = DB_DialogueSetting.password;

            DialogueSetting dialogueSetting = new DialogueSetting();
            dialogueSetting.contactDatabaseId = DB_DialogueSetting.contactDatabaseId;
            dialogueSetting.workspaceId = DB_DialogueSetting.workspaceId;
            dialogueSetting.emailTypeId = DB_DialogueSetting.emailTypeId;
            dialogueSetting.ftpAccountId = DB_DialogueSetting.ftpAccountId;

            String prefix = DB_DialogueSetting.prefix;

            String sequence = DateTime.Now.ToString("yyyyMMddHHmmssfffffff");
            ContactGroup contactGroup = new ContactGroup();
            contactGroup.groupLabel = prefix + sequence;
            contactGroup.groupName = prefix + sequence;

            DirectEmail directEmail = new DirectEmail();
            directEmail.emailLabel = prefix + sequence;
            directEmail.emailName = prefix + sequence;
            directEmail.subject = subject;
            directEmail.description = subject;
            directEmail.fromName = fromName;
            directEmail.fromAddress = fromAddress;
            if (String.IsNullOrEmpty(reportReceiveAddress))
            {
                directEmail.reportReceiveAddress = fromAddress;
            }
            else
            {
                directEmail.reportReceiveAddress = reportReceiveAddress;
            }
            directEmail.htmlContent = mailBody;

            

            DialogueService_new dialogueService_new = new DialogueService_new(authorization.client, authorization.username, authorization.password, null);
            return dialogueService_new.publishingBulkEmail(dialogueSetting, contactGroup, contactfileName, directEmail);
        }
Exemple #2
0
        public SendSmsResult sendSMS(String apiKey, string mobile, string time, string content)
        {
            DialogueSettingDao DialogueSettingDao = new DialogueSettingDao();
            DialogueSettingBO DB_DialogueSetting = DialogueSettingDao.Get(apiKey);
            Authorization authorization = new Authorization();
            authorization.client = DB_DialogueSetting.client;
            authorization.username = DB_DialogueSetting.username;
            authorization.password = DB_DialogueSetting.password;

            string account = DB_DialogueSetting.sms_account;
            string password = DB_DialogueSetting.sms_password;
            string pid = DB_DialogueSetting.sms_pid;

            DialogueService_new dialogueService_new = new DialogueService_new(authorization.client, authorization.username, authorization.password, null);
            return dialogueService_new.sendSMS(account, password, mobile, pid, time, content);
        }
Exemple #3
0
        public ReportData getRerportByJobId(String apiKey, String publishId, DateTime startTime, DateTime endTime)
        {
            DialogueSettingDao DialogueSettingDao = new DialogueSettingDao();
            DialogueSettingBO DB_DialogueSetting = DialogueSettingDao.Get(apiKey);

            Authorization authorization = new Authorization();
            authorization.client = DB_DialogueSetting.client;
            authorization.username = DB_DialogueSetting.username;
            authorization.password = DB_DialogueSetting.password;

            DialogueService_new dialogueService_new = new DialogueService_new(authorization.client, authorization.username, authorization.password, null);
            return dialogueService_new.getRerportByJobId(publishId, startTime, endTime);
        }
Exemple #4
0
        public void exportReportToFtp(String apiKey, String fileNamePrefix, DateTime startTime, DateTime endTime)
        {
            DialogueSettingDao DialogueSettingDao = new DialogueSettingDao();
            DialogueSettingBO DB_DialogueSetting = DialogueSettingDao.Get(apiKey);

            Authorization authorization = new Authorization();
            authorization.client = DB_DialogueSetting.client;
            authorization.username = DB_DialogueSetting.username;
            authorization.password = DB_DialogueSetting.password;

            DialogueService_new dialogueService_new = new DialogueService_new(authorization.client, authorization.username, authorization.password, null);
            dialogueService_new.exportReportToFtp(DB_DialogueSetting.contactDatabaseId, DB_DialogueSetting.ftpAccountId, fileNamePrefix, startTime, endTime);

        }
Exemple #5
0
        public CSVReportData exportReport(String apiKey, DateTime startTime, DateTime endTime)
        {
            DialogueSettingDao DialogueSettingDao = new DialogueSettingDao();
            DialogueSettingBO DB_DialogueSetting = DialogueSettingDao.Get(apiKey);

            Authorization authorization = new Authorization();
            authorization.client = DB_DialogueSetting.client;
            authorization.username = DB_DialogueSetting.username;
            authorization.password = DB_DialogueSetting.password;

            DialogueService_new dialogueService_new = new DialogueService_new(authorization.client, authorization.username, authorization.password, null);

            ExportReportData report = dialogueService_new.exportReport(DB_DialogueSetting.contactDatabaseId, startTime, endTime);
            CSVReportData csvReportData = new CSVReportData();

            csvReportData.sent = Encoding.UTF8.GetString(report.sent);
            csvReportData.opened = Encoding.UTF8.GetString(report.opened);
            csvReportData.clicked = Encoding.UTF8.GetString(report.clicked);
            csvReportData.bounced = Encoding.UTF8.GetString(report.bounced);

            return csvReportData;
        }
Exemple #6
0
        public String registerContact(String apiKey, KeyValuePair[] ContactInfos)
        {
            DialogueSettingDao DialogueSettingDao = new DialogueSettingDao();
            DialogueSettingBO DB_DialogueSetting = DialogueSettingDao.Get(apiKey);

            Authorization authorization = new Authorization();
            authorization.client = DB_DialogueSetting.client;
            authorization.username = DB_DialogueSetting.username;
            authorization.password = DB_DialogueSetting.password;

            DialogueSetting dialogueSetting = new DialogueSetting();
            dialogueSetting.contactDatabaseId = DB_DialogueSetting.contactDatabaseId;
            dialogueSetting.workspaceId = DB_DialogueSetting.workspaceId;
            dialogueSetting.directEmailId = DB_DialogueSetting.directEmailId;

            DialogueService_new dialogueService_new = new DialogueService_new(authorization.client, authorization.username, authorization.password, null);
            return dialogueService_new.registerContact(dialogueSetting, ContactInfos);
        }