Esempio n. 1
0
        async void OnNotifyClicked(object s, EventArgs e)
        {
            manager = SignupManager.DefaultManager;
            emplist = await manager.getEmails();

            emails = new String[emplist.Count];
            for (int i = 0; i < emplist.Count; i++)
            {
                emails[i] = emplist[i].Email;
            }


            var emailMessenger = CrossMessaging.Current.EmailMessenger;

            if (emailMessenger.CanSendEmail)
            {
                // use EmailBuilder fluent interface to construct more complex e-mail with multiple recipients, bcc, attachments etc.
                var email = new EmailMessageBuilder()
                            .To(emails)
                            .Subject("Notification about the schedule")
                            .Body("The latest schedule is updated please check your shifts!")
                            .Build();

                emailMessenger.SendEmail(email);
            }
        }
        public async void sendOnCall()
        {
            manager = SignupManager.DefaultManager;
            emplist = await manager.getEmails();

            //int c = emplist.Count;
            emails = new String[emplist.Count];
            for (int i = 0; i < emplist.Count; i++)
            {
                emails[i] = emplist[i].Email;
            }



            var emailMessenger = CrossMessaging.Current.EmailMessenger;

            if (emailMessenger.CanSendEmail)
            {
                // Send simple e-mail to single receiver without attachments, bcc, cc etc.
                //emailMessenger.SendEmail("*****@*****.**", "Xamarin Messaging Plugin", "Well hello there from Xam.Messaging.Plugin");

                // Alternatively use EmailBuilder fluent interface to construct more complex e-mail with multiple recipients, bcc, attachments etc.
                var email = new EmailMessageBuilder()
                            .To(emails)
                            .Subject("On-Call Shift")
                            .Body("Shift " + shift + " at " + workplace + " on " + workday + " is available.Please pick up!")
                            .Build();

                emailMessenger.SendEmail(email);
            }
        }