public override bool ProcessMessage(AmazonSqsNotification notificationMessage, object queueMessage)
        {
            bool success = false;

            try
            {
                //parse again, to get the SES Complaint from the SQS object
                var complaint = Newtonsoft.Json.JsonConvert.DeserializeObject <AmazonSesComplaintNotification>(notificationMessage.Message);
                GNNotificationSuppressionList suppressionListItem = new GNNotificationSuppressionList();
                suppressionListItem.CreateDateTime = complaint.Complaint.Timestamp;
                suppressionListItem.Category       = "COMPLAINT";
                suppressionListItem.Type           = complaint.Complaint.ComplaintFeedbackType;

                //Store message in DB
                foreach (var recipient in complaint.Complaint.ComplainedRecipients)
                {
                    suppressionListItem.Email = recipient.EmailAddress;
                    db.GNNotificationSuppressionLists.Add(suppressionListItem);
                    db.SaveChanges();
                }
                success = true;
            }
            catch (Exception e1)
            {
                Exception e2 = new Exception("Unable to save complaint.", e1);
                LogUtil.Warn(logger, e2.Message, e2);
                success = false;
            }
            return(success);
        }
        public override bool ProcessMessage(AmazonSqsNotification notificationMessage, object queueMessage)
        {
            bool success = false;

            try
            {
                //parse again, to get the SES Bounce from the SQS object
                var bounce = Newtonsoft.Json.JsonConvert.DeserializeObject <AmazonSesBounceNotification>(notificationMessage.Message);
                if (!bounce.Bounce.BounceType.ToUpper().Equals("TRANSIENT"))   //Ignore transients, keep notifying those emails
                {
                    GNNotificationSuppressionList suppressionListItem = new GNNotificationSuppressionList();
                    suppressionListItem.CreateDateTime = bounce.Bounce.Timestamp;
                    suppressionListItem.Category       = "BOUNCE";
                    suppressionListItem.Type           = bounce.Bounce.BounceType;
                    suppressionListItem.Subtype        = bounce.Bounce.BounceSubType;
                    //suppressionListItem.CreatedBy = ;

                    //Store message in DB
                    foreach (var recipient in bounce.Bounce.BouncedRecipients)
                    {
                        suppressionListItem.Email = recipient.EmailAddress;
                        db.GNNotificationSuppressionLists.Add(suppressionListItem);
                        db.SaveChanges();
                    }
                }
                success = true;
            }
            catch (Exception e1)
            {
                Exception e2 = new Exception("Unable to save bounce.", e1);
                LogUtil.Warn(logger, e2.Message, e2);
                success = false;
            }
            return(success);
        }