Example #1
0
        private Dictionary <string, string> GetMergeField(CreateDemoEnquiryEmailCommand @command)
        {
            var mergedFields = new Dictionary <string, string>()
            {
                { "[customerfirstname]", @command.CustomerFirstname },
                { "[customerlastname]", @command.CustomerLastname },
                { "[customeremail]", @command.CustomerEmail },
                { "[customerphone]", @command.CustomerPhone },
                { "[customeraddress]", @command.CustomerAddress },
                { "[customermessage]", @command.CustomerMessage },
            };

            return(mergedFields);
        }
Example #2
0
        public IActionResult SendRentDemoEmail([FromBody] CreateDemoEnquiryEmailCommand @command)
        {
            var emailNeedsToBeSent = new EmailNeedsToBeSentIntegrationEvent
            {
                IsBodyHtml           = @command.IsBodyhtml,
                FromEmail            = @command.From,
                FromName             = "Demo",
                To                   = new[] { @command.To },
                AggregateId          = Guid.NewGuid().ToString(),
                DisableClickTracking = true,
                DisableOpenTracking  = true,
                MergeFields          = GetMergeField(@command),
                TemplateId           = "1797b49e-4c40-43ff-9220-c95816dadd9e"
            };

            _eventBus.Publish(emailNeedsToBeSent);

            return((IActionResult)Ok(emailNeedsToBeSent));
        }
Example #3
0
        public IActionResult SendBuyDemoEmail([FromBody] CreateDemoEnquiryEmailCommand @command)
        {
            var emailNeedsToBeSent = new EmailNeedsToBeSentIntegrationEvent
            {
                IsBodyHtml           = @command.IsBodyhtml,
                FromEmail            = @command.From,
                FromName             = "Demo",
                To                   = new[] { @command.To },
                AggregateId          = Guid.NewGuid().ToString(),
                DisableClickTracking = true,
                DisableOpenTracking  = true,
                MergeFields          = GetMergeField(@command),
                TemplateId           = "770b116f-fe82-410d-b675-198f45361d5a"
            };

            _eventBus.Publish(emailNeedsToBeSent);

            return((IActionResult)Ok(emailNeedsToBeSent));
        }