public ActionResult sendCampaign(int caid)
        {
            ActionResult result = NotFound();

            try
            {
                if (caid < 0)
                {
                    throw new GeneralException("Wrong Parameters");
                }

                EmailService email = new EmailService(caid);

                EmailerHelper.addEmail(email);

                result = Ok();
            }
            catch (GeneralException ex)
            {
                result = BadRequest(ex.ToString());
            }
            catch (MySqlException msql)
            {
                result = BadRequest(msql.ToString());
            }
            catch (Exception ex)
            {
                result = BadRequest(ex.ToString());
            }
            return(result);
        }
Exemple #2
0
        public virtual void ProcessInstruction(Payment payment)
        {
            foreach (var paymentFileBuilder in PaymentFileBuilders)
            {
                var file = paymentFileBuilder.Build(payment);
                EmailerHelper.SendEmailWithAttachment(Config.EmailContact, file);
            }

            ReleaseInstruction(payment);
        }