private async void ComposeEmail() { var email = new EmailMessage(); var recipient = new EmailRecipient("*****@*****.**", "Janerson Douglas"); email.To.Add(recipient); await EmailManager.ShowComposeNewEmailAsync(email); }
private async void App_UnhandledException(object sender, UnhandledExceptionEventArgs e) { e.Handled = true; var unhandledException = e.Exception; var dialog = new MessageDialog($@"Homebased crashed :( {Environment.NewLine}Please close the application and try again. {Environment.NewLine}But before you do, do you want to mail us the crash report, to see if there's anything we can do?", "Homebased crashed #!$*"); dialog.Commands.Add(new UICommand("Yes", new UICommandInvokedHandler(async cmd => { var sendTo = new EmailRecipient() { Name = "Homebased", Address = "*****@*****.**" }; var mail = new EmailMessage(); mail.Subject = $"Homebased crashed :("; mail.Body = unhandledException.ToString(); mail.To.Add(sendTo); await EmailManager.ShowComposeNewEmailAsync(mail); }))); dialog.Commands.Add(new UICommand("No", new UICommandInvokedHandler(cmd => { }))); await dialog.ShowAsync(); }
private async void ReportButton_Click(object sender, RoutedEventArgs e) { var rec = new EmailRecipient("*****@*****.**"); var mes = new EmailMessage(); mes.To.Add(rec); var result = ""; foreach (var l in _paragraph.Inlines) { if (l is Run) { result += (l as Run).Text; } } var cachedFolder = ApplicationData.Current.TemporaryFolder; var file = await cachedFolder.CreateFileAsync("network_diagnosis.txt", CreationCollisionOption.ReplaceExisting); await FileIO.WriteTextAsync(file, result); var stream = RandomAccessStreamReference.CreateFromFile(file); var attachment = new EmailAttachment(file.Name, stream); mes.Attachments.Add(attachment); mes.Subject = $"【Network】MyerSplash for Windows 10, {App.GetAppVersion()} feedback, {DeviceHelper.OSVersion}"; mes.Body = ResourceLoader.GetForCurrentView().GetString("EmailBody"); await EmailManager.ShowComposeNewEmailAsync(mes); }
public async Task <ActionResult> ContentSources(RegistrationIndexViewModel model) { if (!ModelState.IsValid) { return(View()); } var registration = await _repo.ContentSourceRegistrationRequests.AddOrUpdateAndSaveAsync(new ContentSourceRegistrationRequest() { Email = model.Email }); var recipient = new EmailRecipient(model.Email); var content = new EmailContent() .Title("Fanword Content Sources") .Paragraph("Thank you for your interest in being a content source on Fanword. Click the link below to complete your registration.") .Button(Url.Action("ContentSourceRegistration", "Registration", new { id = registration.Id }, Request.Url.Scheme), "#32c5d2", "#FFF", "Register"); var email = new Email(recipient, "Fanword Content Source Sign-Up", content.ToHtml()); email.Send(); return(RedirectToAction("InitialContentSourcesRegistrationComplete")); }
public async void SendEmail(PetModel pet, string vetName, string vetEmail) { EmailRecipient sendTo = new EmailRecipient() { Address = vetEmail }; EmailMessage mail = new EmailMessage(); mail.Subject = "Petmergency - " + ParseUser.CurrentUser["nameSurname"] + " size bir soru sordu !"; if (pet == null) { mail.Body = "Merhaba " + vetName + " !" + "\n\n" + "Size aşağıdaki soruyu sormak istiyorum." + "\n\n" + "Sorunuz : " + "\n\n" + "Bu e-posta Petmergency uygulaması aracılığı ile iletilmiştir." + "\n\n"; } else { mail.Body = "Merhaba " + vetName + " !" + "\n\n" + "Size aşağıdaki soruyu sormak istiyorum." + "\n\n" + "Sorunuz : " + "\n\n" + "Küçük dostumun bilgileri:" + "\n" + "Adı:" + pet.Name + "\n" + "Doğum Tarihi:" + pet.BirthDate.Date.ToString("dd/MM/yyyy") + "\n" + "Irkı:" + pet.Kind + "\n" + "Cinsi:" + pet.Breed + "\n\n" + "Bu e-posta Petmergency uygulaması aracılığı ile iletilmiştir." + "\n\n"; } mail.To.Add(sendTo); await EmailManager.ShowComposeNewEmailAsync(mail); }
public void Update(EmailRecipientViewModel item) { try { EmailRecipient emailRecipient = mapper.Map <EmailRecipient>(item); Email email = unitOfWork.Emails.Get(filter: e => e.EmailAddress == item.EmailAddress).FirstOrDefault(); if (email == null) { email = new Email(); email.EmailAddress = item.EmailAddress; unitOfWork.Emails.Insert(email); emailRecipient.Email = email; } else { emailRecipient.EmailId = email.Id; } unitOfWork.EmailRecipients.Update(emailRecipient); unitOfWork.Save(); } catch (Exception e) { throw e; } }
public async Task TestActivateDripCampaignAsyncWithAllParameters() { Trace.WriteLine(String.Format("POST /drip_campaigns/{0}/activate with all parameters", DEFAULT_CAMPAIGN_ID)); // Build the drip campaign object var recipient = new EmailRecipient(DEFAULT_RECIPIENT_EMAIL_ADDRESS, DEFAULT_EMAIL_NAME); var dripCampaign = new DripCampaign(recipient); dripCampaign.cc.Add(new EmailRecipient(DEFAULT_CC_EMAIL_ADDRESS_1, DEFAULT_EMAIL_NAME)); dripCampaign.cc.Add(new EmailRecipient(DEFAULT_CC_EMAIL_ADDRESS_2, DEFAULT_EMAIL_NAME)); dripCampaign.bcc.Add(new EmailRecipient(DEFAULT_BCC_EMAIL_ADDRESS_1, DEFAULT_EMAIL_NAME)); dripCampaign.bcc.Add(new EmailRecipient(DEFAULT_BCC_EMAIL_ADDRESS_2, DEFAULT_EMAIL_NAME)); dripCampaign.sender.address = DEFAULT_SENDER_EMAIL_ADDRESS; dripCampaign.sender.name = DEFAULT_SENDER_NAME; dripCampaign.sender.reply_to = DEFAULT_REPLY_TO_EMAIL_ADDRESS; dripCampaign.tags.Add(DEFAULT_TAG_1); dripCampaign.tags.Add(DEFAULT_TAG_2); dripCampaign.tags.Add(DEFAULT_TAG_3); dripCampaign.locale = DEFAULT_LOCALE; dripCampaign.esp_account = DEFAULT_ESP_ACCOUNT_ID; dripCampaign.email_data.Add("amount", "$12.00"); // Make the API call try { var dripCampaignResponse = await dripCampaign.ActivateAsync(DEFAULT_CAMPAIGN_ID); // Validate the response SendwithusClientTest.ValidateResponse(dripCampaignResponse); } catch (AggregateException exception) { Assert.Fail(exception.ToString()); } }
/// <summary> /// Adds a single email recipient to db /// </summary> /// <param name="emailRecipient"><see cref="EmailRecipientDomain"/></param> /// <returns></returns> public int Add(EmailRecipientDomain emailRecipient) { var emailRecipientDb = new EmailRecipient().FromDomainModel(emailRecipient); _context.EmailRecipient.Add(emailRecipientDb); _context.SaveChanges(); return(emailRecipientDb.EmailRecipientId); }
public async Task SendThankYouMail(SchedulerContext db, EmailRecipient item, EmailTrack track) { await SendThankYouMail(item, track); track.IsThankYouMailSent = true; await db.SaveChangesAsync(); }
public ActionResult DeleteConfirmed(int id) { EmailRecipient emailRecipient = db.EmailRecipients.Find(id); db.EmailRecipients.Remove(emailRecipient); db.SaveChanges(); return(RedirectToAction("Index")); }
public void AddEmailRecipient(EmailRecipient emailRecipient, string userId) { using (var context = new ApplicationDbContext()) { context.EmailRecipients.Add(emailRecipient); context.SaveChanges(); } }
public async static Task ShowAsync(EmailRecipient to, String subject) { var email = new EmailMessage(); email.Subject = subject; email.To.Add(to); await EmailManager.ShowComposeNewEmailAsync(email).AsTask().ConfigureAwait(false); }
private static void AssertAddresses(MockEmail email, EmailRecipient from, EmailRecipient ret, EmailRecipient[] to, bool assertCc, EmailRecipient[] cc, bool assertBcc, EmailRecipient bcc) { // From. Address should actually be the return address and the ReplyTo field is set to what it is the from address. Assert.AreEqual(ret.Address, email.From.Address, "'From' email address differs"); Assert.AreEqual(from.DisplayName, email.From.DisplayName, "'From' display name differs"); Assert.AreEqual(from.Address, email.ReplyTo.Address, "'ReplyTo' email address differs"); Assert.AreEqual(from.DisplayName, email.ReplyTo.DisplayName, "'ReplyTo' display name differs"); // To. Assert.AreEqual(to.Length, email.To.Count); for (int index = 0; index < to.Length; ++index) { Assert.AreEqual(to[index].Address, email.To[index].Address, "'To' email address differs"); Assert.AreEqual(to[index].DisplayName, email.To[index].DisplayName, "'To' display name differs"); } // Cc. if (assertCc) { if (cc == null) { Assert.AreEqual(0, email.Cc.Count); } else { Assert.AreEqual(cc.Length, email.Cc.Count); for (var index = 0; index < cc.Length; ++index) { Assert.AreEqual(cc[index].Address, email.Cc[index].Address, "'Cc' email address differs"); Assert.AreEqual(cc[index].DisplayName, email.Cc[index].DisplayName, "'Cc' display name differs"); } } } // Bcc. if (assertBcc) { if (bcc == null) { Assert.AreEqual(0, email.Bcc.Count); } else { Assert.AreEqual(1, email.Bcc.Count); Assert.AreEqual(bcc.Address, email.Bcc[0].Address, "'Bcc' email address differs"); Assert.AreEqual(bcc.DisplayName, email.Bcc[0].DisplayName, "'Bcc' display name differs"); } } // Sender. Assert.IsNull(email.Sender); }
public static EmailRecipientDomain ToDomainModel(this EmailRecipient obj) { return(obj == null ? null : new EmailRecipientDomain() { Id = obj.EmailRecipientId, EmailAddress = obj.EmailAddress, EmailRecipientTypeId = obj.EmailRecipientTypeId, }); }
public void When_Address_And_Name_Are_Set() { var email = "*****@*****.**"; var name = "John Doe"; var emailRecipient = new EmailRecipient(email, name); Assert.AreEqual(email, emailRecipient.Address); Assert.AreEqual(name, emailRecipient.Name); }
private async void ContactMeButtonClickHandler(object sender, RoutedEventArgs e) { var recipient = new EmailRecipient("*****@*****.**", "Djvu Reader developer"); var message = new EmailMessage(); message.To.Add(recipient); message.Subject = "DjVu Reader"; await EmailManager.ShowComposeNewEmailAsync(message); }
public async Task SendReminderMail(SchedulerContext db, EmailRecipient item, EmailTrack track) { await SendReminderEmail(item, track); track.LastRemindedDate = DateTime.Today; track.ReminderCount++; await db.SaveChangesAsync(); }
private EditEmailRecipientViewModel PrepareEmailRecipientVm(EmailRecipient emailRecipient, string userId) { return(new EditEmailRecipientViewModel { EmailRecipient = emailRecipient, Heading = emailRecipient.Id == 0 ? "Dodanie Adresata Wiadomości" : "Edycja Adresata Wiadomości", Addresses = _addressRepository.GetAddresses(userId) }); }
public Variables() { AppName = "Hearthstone Cards"; AppNameShort = "HS Cards"; TwitterHashtag = "#hs-cards"; FeedbackEmailBody = string.Format("Hey Chris,\n\nI wanted to provide some feedback about the '{0}' app:\n\n", AppName); FeedbackEmailRecipient = new EmailRecipient("*****@*****.**", "Christian Lüthold"); BugReportEmailBody = string.Format("Hey Chris,\n\nI wanted to let you know that I found a bug in the '{0}' app:\n\n", AppName); BugReportEmailRecipient = FeedbackEmailRecipient; }
private async void ComposeEmail(string recipient, string subject) { var emailMessage = new EmailMessage(); emailMessage.Subject = subject; var emailRecipient = new EmailRecipient(recipient); emailMessage.To.Add(emailRecipient); await EmailManager.ShowComposeNewEmailAsync(emailMessage); }
private async void BtnSendOneRecipient_Click(object sender, RoutedEventArgs e) { EmailMessage message = new EmailMessage(); EmailRecipient recipient = new EmailRecipient("*****@*****.**", "Marcin Jamro"); message.To.Add(recipient); message.Body = "It is a message sent from a universal application."; message.Subject = "Subject of the message"; await EmailManager.ShowComposeNewEmailAsync(message); }
public async void SendEmail() { EmailRecipient to = new EmailRecipient(AppInfo.Email, AppInfo.PublisherName); EmailMessage mail = new EmailMessage(); mail.Subject = "About " + AppInfo.Name; mail.Body = ""; mail.To.Add(to); await EmailManager.ShowComposeNewEmailAsync(mail); }
private async Task SendThankYouMail(EmailRecipient item, EmailTrack track) { StringBuilder contructMail = new StringBuilder(); contructMail.AppendLine("<p>Hi, </p>"); contructMail.AppendLine("<p></p>"); contructMail.AppendLine("<p>Thank you for clicking the link in our previous mail.</p>"); await MailClient.SendMailAsync(item.Email, item.Name, "Welcome mail", contructMail.ToString()); }
public ActionResult Edit([Bind(Include = "EmailRecipientID,FirstName,LastName,Email,CollegeId,Active")] EmailRecipient emailRecipient) { if (ModelState.IsValid) { db.Entry(emailRecipient).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(emailRecipient)); }
public SendEmailDto(long id, EmailRecipient fromAddress, EmailRecipient toAddress, string messageBody, string subject, string host, int port) { Id = id; FromAddress = fromAddress; MessageBody = messageBody; Subject = subject; Host = host; Port = port; ToAddress = toAddress; }
public ActionResult Create([Bind(Include = "EmailRecipientID,FirstName,LastName,Email,CollegeId,Active")] EmailRecipient emailRecipient) { if (ModelState.IsValid) { db.EmailRecipients.Add(emailRecipient); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(emailRecipient)); }
protected void To(Name name, EmailAddress address) { var recipient = new EmailRecipient { Address = address, Name = name, }; recipient.CreateIds(); to.Add(recipient); }
/// <summary> /// Creates an email object with only the required parameters /// </summary> /// <returns>An email object with only the minimum required parameters set</returns> private static Email BuildBarebonesEmail() { // Construct the template data var templateData = new Dictionary <string, object>(); // Construct the recipient var recipient = new EmailRecipient(DEFAULT_RECIPIENT_EMAIL_ADDRESS); // Construct and return the email return(new Email(DEFAULT_TEMPLATE_ID, templateData, recipient)); }
private async void ComposeMail_OnTap(object sender, TappedRoutedEventArgs e) { var sendTo = new EmailRecipient { Address = Strings.SupportMail }; var mail = new EmailMessage {Subject = Strings.FeedbackLabel}; mail.To.Add(sendTo); await EmailManager.ShowComposeNewEmailAsync(mail); }
private async void HyperlinkButton_Click(object sender, RoutedEventArgs e) { // Windows.ApplicationModel.Email EmailMessage message = new EmailMessage(); // Mail subject EmailRecipient emailRecipient = new EmailRecipient("*****@*****.**"); message.To.Add(emailRecipient); await EmailManager.ShowComposeNewEmailAsync(message); }
public async void sendEmails(string To, string Subject, string Body, Page page) { EmailMessage msg = new EmailMessage(); msg.Body = Body; msg.Subject = Subject; EmailRecipient msgTo = new EmailRecipient(); msgTo.Address = To; msg.To.Add(msgTo); await EmailManager.ShowComposeNewEmailAsync(msg); }
public virtual async Task <Response <string> > ForgotPassword(ForgotPasswordRequest request) { IList <ValidationFailure> errorMessages = new List <ValidationFailure>(); var user = (await _UserRepository.FindByCondition(x => x.UserName.ToLower() == request.UserName.ToLower()).ConfigureAwait(false)).AsQueryable().FirstOrDefault(); if (user == null || user.UserStatuses.StatusValue != "Active") { errorMessages.Add(new ValidationFailure("UserName", "Please check your email for password reset instructions")); } if (errorMessages.Count > 0) { throw new ValidationException(errorMessages); } var generatedPassword = this._PasswordService.GeneratePassword(8); string passwordhash, passwordSalt; _PasswordService.CreatePasswordHash(generatedPassword, out passwordhash, out passwordSalt); user.PasswordHash = passwordhash; user.PasswordSalt = passwordSalt; await _UserRepository.UpdateAsync(user).ConfigureAwait(false); EmailTemplate emailTemplate = (await this._EmailTemplateRepository.FindByCondition(x => x.EmailTemplateName.Equals("ForgotPasswordNotification")).ConfigureAwait(false)).AsQueryable().FirstOrDefault(); if (emailTemplate != null) { EmailRecipient emailRecipient = new EmailRecipient() { EmailTemplateID = emailTemplate.EmailTemplateId, RecipientEmail = user.UserEmail, ToBeProcessedOn = DateTime.UtcNow, EmailLabel = emailTemplate.EmailLabel, EmailSubject = emailTemplate.EmailSubject, EmailSenderEmail = emailTemplate.EmailSenderEmail, EmailContent = emailTemplate.EmailContent.Replace("[Username]", user.UserName).Replace("[password]", generatedPassword), EmailSignature = emailTemplate.EmailSignature, EmailSentOn = DateTime.UtcNow, CreatedDate = DateTime.UtcNow, CreatedBy = user.CreatedBy, IsPending = true, RecipientUserID = user.UserId }; await this._EmailRecipientRepository.AddAsync(emailRecipient).ConfigureAwait(false); } return(new Response <string>($"Please check your email for password reset instructions")); }
private async void email_stack_Tapped(object sender, TappedRoutedEventArgs e) { EmailRecipient sendTo = new EmailRecipient() { Address = Email.Text }; EmailMessage mail = new EmailMessage(); mail.To.Add(sendTo); await EmailManager.ShowComposeNewEmailAsync(mail); }
private void EnsureSenderSpecified() { if (!this.WasSpecifiedByUser("Sender")) { EmailRecipient from = this.message.From; if (from == null || from.SmtpAddress == null || !SmtpAddress.IsValidSmtpAddress(from.SmtpAddress)) { base.WriteError(new LocalizedException(Strings.SenderNotSpecifiedAndNotPresentInMessage), ErrorCategory.InvalidArgument, null); return; } this.Sender = (SmtpAddress)from.SmtpAddress; } }
public static async void Send(Exception e) { EmailRecipient sendTo = new EmailRecipient() { Address = "*****@*****.**" }; EmailMessage mail = new EmailMessage(); mail.Subject = "Feedback for BookMyBook :Error Occurred"; mail.Body = e.ToString() + Environment.NewLine + "Write your feedback here..."; mail.To.Add(sendTo); await EmailManager.ShowComposeNewEmailAsync(mail); }
protected ConstantsBase( string appName, string appNameShort, string twitterHashTag ) { AppName = appName; AppNameShort = appNameShort; TwitterHashtag = twitterHashTag; FeedbackEmailBody = string.Format("Hey Chris,\n\nI wanted to provide some feedback about the '{0}' app:\n\n", AppName); FeedbackEmailRecipient = new EmailRecipient("*****@*****.**", "Christian Lüthold"); BugReportEmailBody = string.Format("Hey Chris,\n\nI wanted to let you know that I found a bug in the '{0}' app:\n\n", AppName); BugReportEmailRecipient = FeedbackEmailRecipient; }
private async void SupportTapped(object sender, RoutedEventArgs e) { var sendTo = new EmailRecipient() { Name = "Homebased", Address = "*****@*****.**" }; var mail = new EmailMessage(); mail.Subject = $"Homebased help me out"; mail.Body = "Hi, I would like some help with the following issue:"; mail.To.Add(sendTo); await EmailManager.ShowComposeNewEmailAsync(mail); }
public static void SendPredefinedEmail(this ISendMailService svc, string contentDomain, string contentID, string subject, string sender, EmailRecipient[] recipients) { var req = new SendPredefinedEmailRequest { Body = new SendPredefinedEmailRequestBody { contentDomain = contentDomain, contentID = contentID, subject = subject, sender = sender, recipients = recipients } }; svc.SendPredefinedEmail(req); }
private async void txtemail2_Tapped(object sender, TappedRoutedEventArgs e) { EmailRecipient sendTo = new EmailRecipient() { Address = "*****@*****.**" }; //generate mail object EmailMessage mail = new EmailMessage(); mail.Subject = "Feedback"; //add recipients to the mail object mail.To.Add(sendTo); //mail.Bcc.Add(sendTo); //mail.CC.Add(sendTo); //open the share contract with Mail only: await EmailManager.ShowComposeNewEmailAsync(mail); }
private async void SendEmail() { //predefine Recipient EmailRecipient sendTo = new EmailRecipient() { Address = "*****@*****.**" }; string FirmwareVersion = "";//DeviceStatus.DeviceFirmwareVersion; string DeviceName = "";// DeviceStatus.DeviceName; //generate mail object EmailMessage mail = new EmailMessage(); mail.Subject = @"关于《微博江湖1.0》应用的反馈"; mail.Body = "\n\r\n\r\n\r我的手机:" + DeviceName + "\n\r系统版本:" + FirmwareVersion; //add recipients to the mail object mail.To.Add(sendTo); //open the share contract with Mail only: await EmailManager.ShowComposeNewEmailAsync(mail); }
private async void AdpEmail_Tapped(object sender, TappedRoutedEventArgs e) { EmailRecipient sendTo = new EmailRecipient() { Name = "Krishna Chaitanya", Address = "*****@*****.**" }; EmailMessage mail = new EmailMessage(); mail.Subject = "OASIS 2015"; mail.Body = ""; mail.To.Add(sendTo); await EmailManager.ShowComposeNewEmailAsync(mail); }
private async void Send_Email(object sender, RoutedEventArgs e) { EmailRecipient sendTo = new EmailRecipient() { Address = "*****@*****.**" }; EmailMessage mail = new EmailMessage(); mail.Subject = "Feedback on Split/Second app"; mail.To.Add(sendTo); await EmailManager.ShowComposeNewEmailAsync(mail); }
private async void GenSecEmail_Tapped(object sender, TappedRoutedEventArgs e) { EmailRecipient sendTo = new EmailRecipient() { Name = "Shivani Mittal", Address = "*****@*****.**" }; EmailMessage mail = new EmailMessage(); mail.Subject = "APOGEE 2015"; mail.Body = ""; mail.To.Add(sendTo); await EmailManager.ShowComposeNewEmailAsync(mail); }
private async void PrezEmail_Tapped(object sender, TappedRoutedEventArgs e) { EmailRecipient sendTo = new EmailRecipient() { Name = "Anubhav Gupta", Address = "*****@*****.**" }; EmailMessage mail = new EmailMessage(); mail.Subject = "APOGEE 2015"; mail.Body = ""; mail.To.Add(sendTo); await EmailManager.ShowComposeNewEmailAsync(mail); }
private async void StageEmail_Tapped(object sender, TappedRoutedEventArgs e) { EmailRecipient sendTo = new EmailRecipient() { Name = "Akshansh Deva", Address = "*****@*****.**" }; /* EmailRecipient sendTo1 = new EmailRecipient() { Name = "Archit Gadhok(Guest Lectures)", Address = "*****@*****.**" };*/ EmailMessage mail = new EmailMessage(); mail.Subject = "OASIS 2015"; mail.Body = ""; mail.To.Add(sendTo); // mail.Bcc.Add(sendTo1); await EmailManager.ShowComposeNewEmailAsync(mail); }
private async void DvmEmail_Tapped(object sender, TappedRoutedEventArgs e) { EmailRecipient sendTo = new EmailRecipient() { Name = "Siddhant Tuli", Address = "*****@*****.**" }; EmailMessage mail = new EmailMessage(); mail.Subject = "OASIS 2015"; mail.Body = ""; mail.To.Add(sendTo); await EmailManager.ShowComposeNewEmailAsync(mail); }
private async void Comment_Click(object sender, RoutedEventArgs e) { EmailRecipient sendTo = new EmailRecipient() { Address = "*****@*****.**" }; EmailMessage mail = new EmailMessage(); mail.Subject = "Feedback for League Season 5 Counters"; mail.To.Add(sendTo); await EmailManager.ShowComposeNewEmailAsync(mail); }
private async void _notificationService_OnNotify(object sender, Notification.Notification e) { if (e is SendEmailNotification) { var notification = (e as SendEmailNotification); EmailRecipient sendTo = new EmailRecipient() { Address = (await _configService.GetConfigAsync()).SupportEmail }; //generate mail object EmailMessage mail = new EmailMessage(); mail.Subject = notification.Subject; mail.Body = notification.Body; //add recipients to the mail object mail.To.Add(sendTo); //mail.Bcc.Add(sendTo); //mail.CC.Add(sendTo); //open the share contract with Mail only: await EmailManager.ShowComposeNewEmailAsync(mail); } if (e is GoToPageNotification) { var notification = (e as GoToPageNotification); } if (e is RefreshFailureNotification) { var message = e as RefreshFailureNotification; await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () => { await _dialogService.ShowMessage(message.Body, message.Subject, buttonConfirmText: "Ok", buttonCancelText: "Contact us", afterHideCallback: (confirmed) => { if (!confirmed) { _notificationService.Notify(new SendEmailNotification() { Subject = $"Download city: unable to download {message.ContractName}", Body = $"Hey folks ! I'm unable to get information from {message.ContractName}" + $"Message: { message.Exception.Message } Inner: {message.Exception.InnerException} Stack: {message.Exception.StackTrace}", }); } }); }); } }
private async void SponzEmail_Tapped(object sender, TappedRoutedEventArgs e) { EmailRecipient sendTo = new EmailRecipient() { Name = "Ojas Malpani", Address = "*****@*****.**" }; EmailMessage mail = new EmailMessage(); mail.Subject = "OASIS 2015"; mail.Body = ""; mail.To.Add(sendTo); await EmailManager.ShowComposeNewEmailAsync(mail); }
private async void PcrEmail_Tapped(object sender, TappedRoutedEventArgs e) { EmailRecipient sendTo = new EmailRecipient() { Name = "Maheep Tripathi", Address = "*****@*****.**" }; EmailMessage mail = new EmailMessage(); mail.Subject = "OASIS 2015"; mail.Body = ""; mail.To.Add(sendTo); await EmailManager.ShowComposeNewEmailAsync(mail); }
public void SendOptInMail(CustomerModel model) { if (!_appSettings.GetValue<bool>("Feature.ExactTarget.DoubleOptIn")) return; if (string.IsNullOrWhiteSpace(model.EmailAddress)) return; var consultant = _consultantContext.Consultant; if (!consultant.Subscription.IsActive()) return; var culture = _appSettings.GetValue("GMF.EmailCulture"); var emailCulture = string.IsNullOrWhiteSpace(model.PreferredLanguage) ? culture : model.PreferredLanguage; var contentDomain = string.Format(_appSettings.GetValue("GMF.EmailContentDomain"), consultant.SubsidiaryCode); var contentID = string.Format(_appSettings.GetValue("GMF.OptInInviteContentId"), emailCulture); var subject = string.Empty; var sender = consultant.PrimaryEmailAddress; var consultantMoniker = !string.IsNullOrWhiteSpace(consultant.PrimaryMoniker) ? "/" + consultant.PrimaryMoniker : string.Empty; var consultantPhoneNumber = (consultant.PrimaryPhoneNumber != null) ? consultant.PrimaryPhoneNumber.Number : ""; var consultantLevel = consultant.ConsultantLevel.HasValue ? consultant.ConsultantLevel.Value : 0; var recipient = new EmailRecipient { Recipient = model.EmailAddress, Attributes = new[] { new EmailAttribute { Name = "CustomerId", Value = model.CustomerId.ToString("N") }, new EmailAttribute { Name = "ConsultantMoniker", Value = consultantMoniker }, new EmailAttribute { Name = "ConsultantFirstName", Value = consultant.FirstName }, new EmailAttribute { Name = "ConsultantLastName", Value = consultant.LastName }, new EmailAttribute { Name = "ConsultantEmailAddress", Value = sender }, new EmailAttribute { Name = "ConsultantPhoneNumber", Value = consultantPhoneNumber }, new EmailAttribute { Name = "ConsultantCareerLevel", Value = consultantLevel.ToString() }, new EmailAttribute { Name = "CustomerFirstName", Value = model.FirstName }, new EmailAttribute { Name = "CustomerLastName", Value = model.LastName }, new EmailAttribute { Name = "PWSDomain", Value = _appSettings.GetValue("GMF.PWSDomain") }, new EmailAttribute { Name = "InTouchDomain", Value = _appSettings.GetValue("GMF.InTouchDomain") }, new EmailAttribute { Name = "EmailAddress", Value = model.EmailAddress } } }; _emailService.SendPredefinedEmail(contentDomain, contentID, subject, sender, new[] { recipient }); }
private async void mailButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) { EmailRecipient sendTo = new EmailRecipient() { Address = (await _configService.GetConfigAsync()).SupportEmail }; // string version = XDocument.Load("ms-appx:///WMAppManifest.xml").Root.Element("App").Attribute("Version").Value; EmailMessage mail = new EmailMessage(); mail.Subject = (await _configService.GetConfigAsync()).ApplicationName; //+ version; mail.To.Add(sendTo); await EmailManager.ShowComposeNewEmailAsync(mail); }
private async void RecEmail_Tapped(object sender, TappedRoutedEventArgs e) { EmailRecipient sendTo = new EmailRecipient() { Name = "Saketh Boddu", Address = "*****@*****.**" }; EmailMessage mail = new EmailMessage(); mail.Subject = "OASIS 2015"; mail.Body = ""; mail.To.Add(sendTo); await EmailManager.ShowComposeNewEmailAsync(mail); }
private async void Button_Click_1(object sender, RoutedEventArgs e) { EmailRecipient sendTo = new EmailRecipient() { Name = "Developer", Address = "*****@*****.**" }; // Create email object EmailMessage mail = new EmailMessage(); mail.Subject = "Error in app Hackr Marks"; mail.Body = exc+"\n what prompted this kindly explain along with your phone model. Thank you\n"; // Add recipients to the mail object mail.To.Add(sendTo); //mail.Bcc.Add(sendTo); //mail.CC.Add(sendTo); // Open the share contract with Mail only: await EmailManager.ShowComposeNewEmailAsync(mail); }
private async void sendEmail(object sender, RoutedEventArgs e) { var emailMessage = new Windows.ApplicationModel.Email.EmailMessage(); Contact c = new Contact(); c.Emails.Add(new ContactEmail() { Address = "*****@*****.**" }); var email = c.Emails.FirstOrDefault<ContactEmail>(); if (email != null) { var emailRecipient = new EmailRecipient(email.Address); emailMessage.To.Add(emailRecipient); } await EmailManager.ShowComposeNewEmailAsync(emailMessage); }
private async void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (ratee.SelectedIndex == 0) { ratee.SelectedItem = null; if (signintext.Text == "Sign In") { /* ((App)Application.Current).OneDriveClient = OneDriveClientExtensions.GetUniversalClient(this.scopes); if (!((App)Application.Current).OneDriveClient.IsAuthenticated) { await ((App)Application.Current).OneDriveClient.AuthenticateAsync(); } Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; localSettings.Values["signin"] = "yes"; signintext.Text = "Sign Out"; */ // await AuthenticateUser(false); } else { //TODO }/* else if(signintext.Text == "Sign Out"){ ((App)Application.Current).OneDriveClient = OneDriveClientExtensions.GetUniversalClient(this.scopes); await ((App)Application.Current).OneDriveClient.SignOutAsync(); Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; localSettings.Values["signin"] = "no"; signintext.Text = "Sign In"; } */ } if (ratee.SelectedIndex == 1) { ratee.SelectedItem = null; } if (ratee.SelectedIndex == 2) { Tracker myTracker = EasyTracker.GetTracker(); myTracker.SendEvent("Feedback", "Send Feedback", null, 4); ratee.SelectedItem = null; EmailMessage objEmail = new EmailMessage(); string version = "Version: " + String.Format("{0}.{1}.{2}.{3}", Package.Current.Id.Version.Major, Package.Current.Id.Version.Minor, Package.Current.Id.Version.Build, Package.Current.Id.Version.Revision); objEmail.Body = "Enter Your Feedback here..."; objEmail.Subject = "PDF Me Universal - Feedback - " + version; EmailRecipient em = new EmailRecipient("*****@*****.**"); objEmail.To.Add(em); await EmailManager.ShowComposeNewEmailAsync(objEmail); } }
public static async Task SendEmailWithLogsAsync(string recipient, string appName) { EmailRecipient emailRecipient = new EmailRecipient(recipient); EmailMessage emailMsg = new EmailMessage { Subject = string.Format("Feedback from {0} with logs", appName) }; emailMsg.To.Add(emailRecipient); //emailMsg.Body = await ReadAllLogsIntoStringAsync(); // LOLLO this only works with a short body... string body = await ReadAllLogsIntoStringAsync(); using (var ms = new InMemoryRandomAccessStream()) { using (var s4w = ms.AsStreamForWrite()) { using (var sw = new StreamWriter(s4w, Encoding.UTF8)) { await sw.WriteAsync(body); await sw.FlushAsync(); // LOLLO NOTE the emails are broken with Outlook, they work with the mail app tho // https://msdn.microsoft.com/en-us/library/windows/apps/xaml/mt269391.aspx // the following brings up a preview with only the beginning of the body, at least with Outlook. // it truncates the body if it is too long, like with mailto: // emailMsg.SetBodyStream(EmailMessageBodyKind.PlainText, RandomAccessStreamReference.CreateFromStream(ms0)); // the following instead does not work at all, at least with Outlook: no attachments are attached; the email app works fine emailMsg.Body = "I have attached the logs"; ms.Seek(0); var att = new EmailAttachment("Logs.txt", RandomAccessStreamReference.CreateFromStream(ms)); //, "text/plain"); emailMsg.Attachments.Add(att); //await s4w.FlushAsync(); //await ms.FlushAsync(); emailMsg.Attachments[0].EstimatedDownloadSizeInBytes = ms.Size; await EmailManager.ShowComposeNewEmailAsync(emailMsg); //.AsTask().ConfigureAwait(false); } } } }
//app feedback private async void AppBarButton_Click_2(object sender, RoutedEventArgs e) { // Define Recipient EmailRecipient sendTo = new EmailRecipient() { Name = "MOHAMED EL_SAQER", Address = "*****@*****.**" }; // Create email object EmailMessage mail = new EmailMessage(); mail.Subject = "this is the Subject"; mail.Body = "this is the Body"; // Open the share contract with Mail only: await EmailManager.ShowComposeNewEmailAsync(mail); }
public void SendConfirmationEmail(ConfirmationEmailViewModel confirmationEmailViewModel) { var consultant = _consultantContext.Consultant; if (!consultant.Subscription.IsActive()) return; if (!string.IsNullOrWhiteSpace(consultant.PrimaryEmailAddress)) { var queryService = _quartetClientFactory.GetCustomersQueryServiceClient(); var order = queryService.GetOrderById(confirmationEmailViewModel.OrderId); if (order != null) { var customer = queryService.GetCustomer(order.CustomerId); if (customer != null && customer.EmailAddress != null && !string.IsNullOrWhiteSpace(customer.EmailAddress.Address)) { var webUiCulture = Thread.CurrentThread.CurrentUICulture; var preferredLanguage = customer.ContactPreferences.PreferredLanguage; var emailCulture = preferredLanguage != null ? new CultureInfo(preferredLanguage) : webUiCulture; Thread.CurrentThread.CurrentUICulture = emailCulture; try { var contentDomain = string.Format(_appSettings.GetValue("GMF.EmailContentDomain"), consultant.SubsidiaryCode); var contentID = string.Format(_appSettings.GetValue("GMF.ConfirmationEmailContentId"), emailCulture.Name); var customerEmailAddress = customer.EmailAddress.Address; var subject = Resources.GetString("ORDERCONFIRMATIONEMAILSUBJECT"); var consultantMoniker = !string.IsNullOrWhiteSpace(consultant.PrimaryMoniker) ? "/" + consultant.PrimaryMoniker : string.Empty; var consultantPhoneNumber = (consultant.PrimaryPhoneNumber != null) ? consultant.PrimaryPhoneNumber.Number : null; var consultantLevel = consultant.ConsultantLevel.HasValue ? consultant.ConsultantLevel.Value : 0; var customerId = customer.LegacyContactId.HasValue ? customer.LegacyContactId.Value.ToString() : customer.CustomerId.ToString("N"); var hasPws = consultant.Subscription.IsActive(); var freeShipping = false; if (hasPws) { var freeShippingAttributeKey = Guid.Parse(_appSettings.GetValue("PwsSubscription_AttributeKey_FreeShipping")); var freeShippingAttribute = consultant.Subscription.SubscriptionAttributes.Where(a => a.AttributeKey == freeShippingAttributeKey).FirstOrDefault(); freeShipping = freeShippingAttribute.IsSelected(); } var statementsXml = StatementsXml(confirmationEmailViewModel); var productsXml = ProductsXml(confirmationEmailViewModel.OrderId); var recipient = new EmailRecipient { Recipient = customerEmailAddress, Attributes = new[] { new EmailAttribute { Name = "CustomerId", Value = customerId }, new EmailAttribute { Name = "ConsultantMoniker", Value = (consultantMoniker != null)? consultantMoniker: string.Empty }, new EmailAttribute { Name = "ConsultantFirstName", Value = consultant.FirstName }, new EmailAttribute { Name = "ConsultantLastName", Value = consultant.LastName }, new EmailAttribute { Name = "ConsultantEmailAddress", Value = consultant.PrimaryEmailAddress }, new EmailAttribute { Name = "ConsultantPhoneNumber", Value = (consultantPhoneNumber != null)? consultantPhoneNumber: string.Empty }, new EmailAttribute { Name = "ConsultantCareerLevel", Value = consultantLevel.ToString() }, new EmailAttribute { Name = "CustomerFirstName", Value = customer.ContactInformation.FirstName }, new EmailAttribute { Name = "CustomerLastName", Value = customer.ContactInformation.LastName }, new EmailAttribute { Name = "EmailAddress", Value = customerEmailAddress }, new EmailAttribute { Name = "FreeShipping", Value = freeShipping ? "1" : "0" }, new EmailAttribute { Name = "HasPws", Value = hasPws ? "1" : "0" }, new EmailAttribute { Name = "Message", Value = statementsXml }, new EmailAttribute { Name = "OrderID", Value = order.ConfirmationNumber }, new EmailAttribute { Name = "PWSDomain", Value = _appSettings.GetValue("GMF.PWSDomain") }, new EmailAttribute { Name = "InTouchDomain", Value = _appSettings.GetValue("GMF.InTouchDomain") }, new EmailAttribute { Name = "ProductTable", Value = productsXml } } }; _emailService.SendPredefinedEmail(contentDomain, contentID, subject, consultant.PrimaryEmailAddress, new[] { recipient }); } finally { Thread.CurrentThread.CurrentUICulture = webUiCulture; } } } } }