public static EmailQueueMessage Parse(string messageString)
        {
            var splitString = messageString.Split('|');
            var jobID = splitString[0];
            var textBlobName = splitString[1];
            var recipientEmail = splitString[2];

            if (string.IsNullOrEmpty(jobID))
            {
                throw new FormatException("Job ID cannot be empty.");
            }
            if (string.IsNullOrEmpty(textBlobName))
            {
                throw new FormatException("Text blob name cannot be empty.");
            }
            if (string.IsNullOrEmpty(recipientEmail))
            {
                throw new FormatException("Recipient email cannot be empty.");
            }

            var message = new EmailQueueMessage(Guid.Parse(jobID), textBlobName, recipientEmail);
            return message;
        }
Example #2
0
        public static EmailQueueMessage Parse(string messageString)
        {
            var splitString    = messageString.Split('|');
            var jobID          = splitString[0];
            var textBlobName   = splitString[1];
            var recipientEmail = splitString[2];

            if (string.IsNullOrEmpty(jobID))
            {
                throw new FormatException("Job ID cannot be empty.");
            }
            if (string.IsNullOrEmpty(textBlobName))
            {
                throw new FormatException("Text blob name cannot be empty.");
            }
            if (string.IsNullOrEmpty(recipientEmail))
            {
                throw new FormatException("Recipient email cannot be empty.");
            }

            var message = new EmailQueueMessage(Guid.Parse(jobID), textBlobName, recipientEmail);

            return(message);
        }
Example #3
0
 private void CreateEmailTask(Guid jobID, string textBlobName, string recipientEmail)
 {
     var message = new EmailQueueMessage(jobID, textBlobName, recipientEmail);
     var wrappedMessage = new CloudQueueMessage(message.ToString());
     AzureQueues.EmailQueue.AddMessage(wrappedMessage);
 }