public void StartTriggeredSend(string externalKey)
        {
            var ts = new ExactTargetApi.TriggeredSendDefinition
            {
                Client = _config.ClientId.HasValue ? new ClientID { ID = _config.ClientId.Value, IDSpecified = true } : null,
                CustomerKey = externalKey,
                TriggeredSendStatus = TriggeredSendStatusEnum.Active,
                TriggeredSendStatusSpecified = true
            };

            string requestId, overallStatus;
            var result = _client.Update(new UpdateOptions(), new APIObject[] { ts }, out requestId, out overallStatus);
            ExactTargetResultChecker.CheckResult(result.FirstOrDefault());
        }
Exemplo n.º 2
0
        public int CreateTriggeredSendDefinition(
            string externalId,
            int emailId,
            string dataExtensionCustomerKey,
            string deliveryProfileCustomerKey,
            string name,
            string description,
            string priority = "")
        {
            var ts = new ExactTargetApi.TriggeredSendDefinition
            {
                Client = _config.ClientId.HasValue ? new ClientID {
                    ID = _config.ClientId.Value, IDSpecified = true
                } : null,
                Email = new ExactTargetApi.Email {
                    ID = emailId, IDSpecified = true
                },
                SendSourceDataExtension = new ExactTargetApi.DataExtension {
                    CustomerKey = dataExtensionCustomerKey
                },
                Name                = name,
                Description         = description,
                CustomerKey         = externalId,
                TriggeredSendStatus = TriggeredSendStatusEnum.Active,
                SendClassification  = new SendClassification
                {
                    CustomerKey = "Default Transactional"
                },
                IsMultipart          = true,
                IsMultipartSpecified = true,
                DeliveryProfile      = new ExactTargetApi.DeliveryProfile
                {
                    CustomerKey = deliveryProfileCustomerKey
                },
                IsWrapped          = true,
                IsWrappedSpecified = true,
                Priority           = priority
            };

            string requestId, status;
            var    result = _client.Create(new CreateOptions(), new APIObject[] { ts }, out requestId, out status);

            ExactTargetResultChecker.CheckResult(result.FirstOrDefault());

            return(result.First().NewID);
        }
Exemplo n.º 3
0
        public void StartTriggeredSend(string externalKey)
        {
            var ts = new ExactTargetApi.TriggeredSendDefinition
            {
                Client = _config.ClientId.HasValue ? new ClientID {
                    ID = _config.ClientId.Value, IDSpecified = true
                } : null,
                CustomerKey                  = externalKey,
                TriggeredSendStatus          = TriggeredSendStatusEnum.Active,
                TriggeredSendStatusSpecified = true
            };

            string requestId, overallStatus;
            var    result = _client.Update(new UpdateOptions(), new APIObject[] { ts }, out requestId, out overallStatus);

            ExactTargetResultChecker.CheckResult(result.FirstOrDefault());
        }
        public int CreateTriggeredSendDefinition(
            string externalId,
            int emailId, 
            string dataExtensionCustomerKey,
            string deliveryProfileCustomerKey,
            string name, 
            string description,
			string priority = "")
        {
            var ts = new ExactTargetApi.TriggeredSendDefinition
            {
                Client = _config.ClientId.HasValue ? new ClientID { ID = _config.ClientId.Value, IDSpecified = true } : null,
                Email = new ExactTargetApi.Email { ID = emailId, IDSpecified = true },
                SendSourceDataExtension = new ExactTargetApi.DataExtension { CustomerKey = dataExtensionCustomerKey },
                Name = name,
                Description = description,
                CustomerKey = externalId,
                TriggeredSendStatus = TriggeredSendStatusEnum.Active,
                SendClassification = new SendClassification
                {
                    CustomerKey = "Default Transactional"
                },
                IsMultipart = true,
                IsMultipartSpecified = true,
                DeliveryProfile = new ExactTargetApi.DeliveryProfile
                {
                    CustomerKey = deliveryProfileCustomerKey
                },
                IsWrapped = true,
                IsWrappedSpecified = true,
                Priority = priority
            };

            string requestId, status;
            var result = _client.Create(new CreateOptions(), new APIObject[] { ts }, out requestId, out status);

            ExactTargetResultChecker.CheckResult(result.FirstOrDefault());

            return result.First().NewID;
        }