Exemplo n.º 1
0
        /// <summary>
        /// Send Bulk Emails CSV Send bulk merge email. Required Access Level: SendHttp
        /// </summary>
        /// <exception cref="ElasticEmail.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="mergeEmailPayload">Email data</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of EmailSend</returns>
        public async System.Threading.Tasks.Task <EmailSend> EmailsMergefilePostAsync(MergeEmailPayload mergeEmailPayload, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            ElasticEmail.Client.ApiResponse <EmailSend> localVarResponse = await EmailsMergefilePostWithHttpInfoAsync(mergeEmailPayload, cancellationToken).ConfigureAwait(false);

            return(localVarResponse.Data);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Send Bulk Emails CSV Send bulk merge email. Required Access Level: SendHttp
        /// </summary>
        /// <exception cref="ElasticEmail.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="mergeEmailPayload">Email data</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (EmailSend)</returns>
        public async System.Threading.Tasks.Task <ElasticEmail.Client.ApiResponse <EmailSend> > EmailsMergefilePostWithHttpInfoAsync(MergeEmailPayload mergeEmailPayload, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            // verify the required parameter 'mergeEmailPayload' is set
            if (mergeEmailPayload == null)
            {
                throw new ElasticEmail.Client.ApiException(400, "Missing required parameter 'mergeEmailPayload' when calling EmailsApi->EmailsMergefilePost");
            }


            ElasticEmail.Client.RequestOptions localVarRequestOptions = new ElasticEmail.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };


            var localVarContentType = ElasticEmail.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = ElasticEmail.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.Data = mergeEmailPayload;

            // authentication (apikey) required
            if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("X-ElasticEmail-ApiKey")))
            {
                localVarRequestOptions.HeaderParameters.Add("X-ElasticEmail-ApiKey", this.Configuration.GetApiKeyWithPrefix("X-ElasticEmail-ApiKey"));
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PostAsync <EmailSend>("/emails/mergefile", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("EmailsMergefilePost", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Send Bulk Emails CSV Send bulk merge email. Required Access Level: SendHttp
 /// </summary>
 /// <exception cref="ElasticEmail.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="mergeEmailPayload">Email data</param>
 /// <returns>EmailSend</returns>
 public EmailSend EmailsMergefilePost(MergeEmailPayload mergeEmailPayload)
 {
     ElasticEmail.Client.ApiResponse <EmailSend> localVarResponse = EmailsMergefilePostWithHttpInfo(mergeEmailPayload);
     return(localVarResponse.Data);
 }