public void FunctionHandler(RoutedPodioEvent e, ILambdaContext context) { //string serviceAcccount = Environment.GetEnvironmentVariable("GOOGLE_SERVICE_ACCOUNT"); //var cred = GoogleCredential.FromJson(serviceAcccount).CreateScoped(Scopes).UnderlyingCredential; //var google = new GoogleIntegration(); //var gmail = new GmailService(new BaseClientService.Initializer() //{ // HttpClientInitializer = cred, // ApplicationName = ApplicationName, //}); try { var gdriveLinks = "BODY: " + "https://docs.google.com/document/d/1tkVbKR0f4w-JKTGExNvNnWHwy2hPpFlDK_-ho30gtc4/export"; var mailMessage = _saasyGmail.BuildMessage("*****@*****.**", new string[] { "*****@*****.**" }, "~1010101~", gdriveLinks); var success = _saasyGmail.SendEmail(mailMessage); var result = success.Result; context.Logger.LogLine($"--- Email sent: {success}"); } // catch (System.Exception ex) { context.Logger.LogLine($"{e.clientId} - {ex.Message}"); throw ex; } // }
private async Task SendEmailToSupport(string body, string title) { if (_isDev) { return; } await _gmailService.SendEmail(new List <MailAddress> { new MailAddress("*****@*****.**"), new MailAddress("*****@*****.**") }, body, title ); }
public void Critical(Exception e) { var strBuilder = new StringBuilder(); strBuilder.Append(e.Message); strBuilder.Append(" | "); strBuilder.Append(e.TargetSite == null ? null : e.TargetSite.Name); strBuilder.AppendLine(); strBuilder.AppendLine(e.StackTrace); _gmailService.SendEmail(new List <MailAddress> { new MailAddress("*****@*****.**") }, strBuilder.ToString(), "Critical exception!").Wait(); Error(null, null, e); }