Exemple #1
0
        protected void btnSMSSend_Click(object sender, EventArgs e)
        {
            bool   sendToParents = cbEmailSendToParents.Checked;
            string subject       = tbSubject.Text;
            string body          = tbBody.Text;

            if (Page.IsValid)
            {
                _rockContext = new RockContext();
                var communication = UpdateCommunication(_rockContext);

                if (communication != null)
                {
                    AddRecepients(communication, cbSMSSendToParents.Checked);

                    communication.SMSMessage            = tbMessage.Text;
                    communication.SMSFromDefinedValueId = DefinedValueCache.Get(CurrentGroup.GetAttributeValue("TextMessageFrom").AsGuid()).Id;

                    communication.Status                = CommunicationStatus.Approved;
                    communication.ReviewedDateTime      = RockDateTime.Now;
                    communication.ReviewerPersonAliasId = CurrentPersonAliasId;

                    _rockContext.SaveChanges();
                    var transaction = new Rock.Transactions.SendCommunicationTransaction();
                    transaction.CommunicationId = communication.Id;
                    transaction.PersonAlias     = CurrentPersonAlias;
                    Rock.Transactions.RockQueue.TransactionQueue.Enqueue(transaction);
                }
            }
            cbSMSSendToParents.Checked = false;
            pnlEmail.Visible           = false;
            pnlSMS.Visible             = false;
            pnlMain.Visible            = true;
            maSent.Show("Your message will be been sent shortly.", ModalAlertType.Information);
        }
Exemple #2
0
        private void showRosterEmail(int?id)
        {
            hfCommunication.Value = id.ToString();
            CurrentGroup.LoadAttributes();
            cbEmailSendToParents.Visible = CurrentGroup.GetAttributeValue("AllowEmailParents").AsBoolean();
            pnlMain.Visible  = false;
            pnlEmail.Visible = true;

            DisplayEmailRecipients();
        }
Exemple #3
0
        protected void btnEmail_Click(object sender, EventArgs e)
        {
            tbBody.Text    = "";
            tbSubject.Text = "";

            CurrentGroup.LoadAttributes();
            cbEmailSendToParents.Visible = CurrentGroup.GetAttributeValue("AllowEmailParents").AsBoolean();
            pnlMain.Visible  = false;
            pnlEmail.Visible = true;

            DisplayEmailRecipients();
        }
Exemple #4
0
        protected void btnSMS_Click(object sender, EventArgs e)
        {
            tbMessage.Text = "";

            CurrentGroup.LoadAttributes();
            cbSMSSendToParents.Visible = CurrentGroup.GetAttributeValue("AllowEmailParents").AsBoolean();
            pnlMain.Visible            = false;
            pnlSMS.Visible             = true;

            DisplaySMSRecipients();

            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "smsCharCount", smsScript, true);
        }
Exemple #5
0
        protected void btnEmail_Click(object sender, EventArgs e)
        {
            gMembers.SelectedKeys.Clear();
            hfCommunication.Value = null;
            // If we have a CommandArgument, then we should only select one member.
            if (sender is LinkButton && !string.IsNullOrWhiteSpace((( LinkButton )sender).CommandArgument))
            {
                hfCommunication.Value = (( LinkButton )sender).CommandArgument;
                gMembers.SelectedKeys.Add((( LinkButton )sender).CommandArgument.AsInteger());
            }
            tbBody.Text    = "";
            tbSubject.Text = "";

            CurrentGroup.LoadAttributes();
            cbEmailSendToParents.Visible = CurrentGroup.GetAttributeValue("AllowEmailParents").AsBoolean();
            pnlMain.Visible  = false;
            pnlEmail.Visible = true;

            DisplayEmailRecipients();
        }