public async Task SendMessage(MessagePayLoad payload) { string data = JsonConvert.SerializeObject(payload); Message message = new Message(Encoding.UTF8.GetBytes(data)); await _queueClient.SendAsync(message); }
private async Task SendMessage(MessagePayLoad message) { HttpClient client = new HttpClient(); string messageJson = JsonSerializer.Serialize(message); string token = await GetToken(); client.DefaultRequestHeaders.Authorization = AuthenticationHeaderValue.Parse(token); client.PostAsync("https://localhost:5002/api/email", new StringContent(messageJson, Encoding.UTF8, "application/json")); }
public void SendNewUserEmail(MessagePayLoad message) { string messageFrom = "*****@*****.**"; var smtpClient = new SmtpClient("smtp.gmail.com") { Port = 587, Credentials = new NetworkCredential(messageFrom, "@nt@lis12"), EnableSsl = true, }; smtpClient.Send(messageFrom, message.Recipents, message.Subject, message.Body); }
private Task QueueMessage(MessagePayLoad message) { return(_sender.SendMessage(message)); }
public void Send(MessagePayLoad message) { EmailSender emailSender = new EmailSender(); emailSender.SendNewUserEmail(message); }