예제 #1
0
        public TemplateEmail PostTemplate(TemplateEmail template)
        {
            TemplateEmail t = db.Templates.Add(template);

            db.SaveChanges();
            return(t);
        }
        private void GetResultsContent(StringBuilder sb, TemplateEmail templateEmail, int index, IEmployer employer, JobAdEntry jobAd, ICollection <Member> members)
        {
            if (index > 0)
            {
                sb.AppendLine();
            }
            sb.AppendLine("<p>");
            sb.Append("  <span class=\"jobAdTitle\" data-jobadid=\"").Append(jobAd.Id).Append("\">").Append(jobAd.Title).Append("</span> - ").Append(members.Count).Append(" suggested candidate").AppendLine(members.Count == 1 ? "" : "s");
            sb.AppendLine("</p>");
            sb.AppendLine("<p>");

            var resultsWritten = 0;

            AppendResults(sb, templateEmail, employer, new MemberSearchResults {
                MemberIds = members.Select(m => m.Id).ToArray()
            }, 0, Math.Min(members.Count, MaxResultsPerJobAd), true, ref resultsWritten);

            if (members.Count > MaxResultsPerJobAd)
            {
                sb.AppendLine();
                sb.AppendLine("  <div>");
                var tinyUrl = GetTinyUrl(templateEmail, true, "~/employers/login", "returnUrl", new ReadOnlyApplicationUrl("~/employers/candidates/suggested/" + jobAd.Id).PathAndQuery);
                sb.AppendLine("    <a href=\"" + tinyUrl + "\">All suggested candidates for this job ad</a>.");
                sb.AppendLine("  </div>");
            }

            sb.AppendLine();
            sb.AppendLine("</p>");
        }
예제 #3
0
 protected void GetPlainBodyEnd(TemplateEmail email, bool includeSignature, StringBuilder sb)
 {
     if (includeSignature)
     {
         GetPlainMemberSignature(email, sb);
     }
 }
예제 #4
0
        /// <summary>
        /// Handles the Click event of the SendEmail control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void SendEmail_Click([NotNull] object sender, [NotNull] EventArgs e)
        {
            if (this.EmailAddress.Text.Length == 0)
            {
                this.PageContext.AddLoadMessage(this.GetText("need_email"), MessageTypes.warning);
                return;
            }

            try
            {
                var emailTopic = new TemplateEmail("EMAILTOPIC")
                {
                    TemplateParams = { ["{message}"] = this.Message.Text.Trim() }
                };

                // send a change email message...
                emailTopic.SendEmail(new MailAddress(this.EmailAddress.Text.Trim()), this.Subject.Text.Trim());

                BuildLink.Redirect(ForumPages.posts, "t={0}", this.PageContext.PageTopicID);
            }
            catch (Exception x)
            {
                this.Logger.Log(this.PageContext.PageUserID, this, x);
                this.PageContext.AddLoadMessage(this.GetTextFormatted("failed", x.Message), MessageTypes.danger);
            }
        }
예제 #5
0
        private string GetContent(TemplateEmail templateEmail, IRegisteredUser member, JobAdEntry jobAd, string coverLetter)
        {
            var sb = new StringBuilder();

            sb.AppendLine("<p>");
            sb.AppendLine();
            sb.AppendLine("  Hi,");
            sb.AppendLine();
            sb.AppendLine("</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  We wanted to let you know that " + member.FullName + " has applied for the");
            sb.AppendLine("  " + jobAd.Title + " job " + (jobAd.Integration.ExternalReferenceId == null ? "" : " (ref# " + jobAd.Integration.ExternalReferenceId + ")"));
            sb.AppendLine("  on <a href=\"" + GetTinyUrl(templateEmail, false, "~/employers") + "\">LinkMe.com.au</a>.");
            sb.AppendLine("  You can also see their online resume");
            sb.AppendLine("  <a href=\"" + GetTinyUrl(templateEmail, true, "~/employers/candidates", "candidateId", member.Id.ToString()) + "\">here</a>.");
            sb.AppendLine("</p>");
            sb.AppendLine();
            sb.AppendLine("<p>");
            sb.AppendLine("  " + member.FirstName + " attached a cover letter:");
            sb.AppendLine("</p>");
            sb.AppendLine("<p style=\"padding-left:40px\">");
            sb.AppendLine(HtmlUtil.LineBreaksToHtml(HttpUtility.HtmlEncode(coverLetter)));
            sb.AppendLine("</p>");
            sb.AppendLine();
            sb.AppendLine("<br />");
            return(sb.ToString());
        }
        private string GetContent(TemplateEmail templateEmail, ICommunicationRecipient member)
        {
            var sb = new StringBuilder();

            sb.AppendLine("<p>");
            sb.AppendLine("  Dear " + member.FirstName + ",");
            sb.AppendLine("</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  Your work status on LinkMe has been changed from 'Actively Looking for Work'");
            sb.AppendLine("  to 'Not Looking but Happy to Talk'.");
            sb.AppendLine("  This means that an employer who views your resume may think that you are no longer looking for work,");
            sb.AppendLine("  and so may not contact you for opportunities.");
            sb.AppendLine("</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  If this is not accurate, you can");
            sb.AppendLine("  <a href=\"" + GetTinyUrl(templateEmail, true, "~/members/profile/status/update") + "\">change your work status</a>");
            sb.AppendLine("  to:");
            sb.AppendLine("</p>");
            sb.AppendLine("<ol>");
            sb.AppendLine("  <li>'Actively Looking for Work', or<p /></li>");
            sb.AppendLine("  <li>'Immediately Available', or<p /></li>");
            sb.AppendLine("  <li>'Not Looking for Work'</li>");
            sb.AppendLine("</ol>");
            sb.AppendLine("<p>");
            sb.AppendLine("  Please note that if you indicate that you are Immediately Available");
            sb.AppendLine("  or Actively Looking for Work,");
            sb.AppendLine("  your status will have to be confirmed regularly.");
            sb.AppendLine("</p>");
            return(sb.ToString());
        }
        private string GetContent(TemplateEmail templateEmail, IRegisteredUser employer, int quantity)
        {
            var sb = new StringBuilder();

            sb.AppendLine("<p>Hi " + employer.FirstName + "</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  Thank you for using LinkMe for your candidate sourcing");
            sb.AppendLine("  - our records show that you have " + quantity + " contact credits");
            sb.AppendLine("  left in your account that are due to expire in one month.");
            sb.AppendLine("</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  To use the remaining contact credits,");
            sb.AppendLine("  or to purchase further credits, please");
            sb.AppendLine("  <a href=\"" + GetTinyUrl(templateEmail, true, "~/employers/login") + "\">log in</a>");
            sb.AppendLine("  to LinkMe to search for and");
            sb.AppendLine("  contact candidates that are available for your current opportunities.");
            sb.AppendLine("</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  To discuss further purchase options,");
            sb.AppendLine("  please contact me on 1800 LINK ME at your earliest convenience.");
            sb.AppendLine("</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  We look forward to seeing you on our site again soon.");
            sb.AppendLine("</p>");
            return(sb.ToString());
        }
예제 #8
0
        private string GetContent(TemplateEmail templateEmail, ICommunicationRecipient employer)
        {
            var sb = new StringBuilder();

            sb.AppendLine("<p>Hi " + employer.FirstName + "</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  Thank you for using LinkMe for your candidate sourcing");
            sb.AppendLine("  - our records show that you have no remaining contact credits in your account.");
            sb.AppendLine("</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  To purchase more candidate contact credits for continued access to LinkMe's");
            sb.AppendLine("  resume database candidates,");
            sb.AppendLine("  <a href=\"" + GetTinyUrl(templateEmail, true, "~/employers/products/neworder") + "\">click here</a>.");
            sb.AppendLine("  All data associated with your account,");
            sb.AppendLine("  such as folders and saved searches, will remain available to you.");
            sb.AppendLine("  Once logged in, you can use our secure credit card transaction process");
            sb.AppendLine("  to purchase more credits.");
            sb.AppendLine("</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  Did you know that LinkMe offers subscriptions for unlimited access");
            sb.AppendLine("  to the resume database for larger volume users?");
            sb.AppendLine("  Call us on 1800 546 563 to find out how an annual subscription");
            sb.AppendLine("  to LinkMe may be more cost effective for your organisation.");
            sb.AppendLine("</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  We look forward to seeing you on our site again soon.");
            sb.AppendLine("</p>");
            return(sb.ToString());
        }
예제 #9
0
 private static bool ShouldCombineEmails(TemplateEmail one, TemplateEmail two)
 {
     return(GetComparisonType(one) == GetComparisonType(two) &&
            IsSameAddress(one.To, two.To) &&
            IsSameAddress(one.Copy, two.Copy) &&
            IsAccountManagerNoActivityEmail(one) == IsAccountManagerNoActivityEmail(two));
 }
예제 #10
0
        protected static string GetTrackingPixelUrl(TemplateEmail email)
        {
            var applicationPath = "~/url/" + email.Id.ToString("n") + ".aspx";

            // return _webSiteQuery.GetUrl(WebSite.LinkMe, email.Vertical, false, applicationPath).AbsoluteUri;
            return(new ApplicationUrl(applicationPath).AbsoluteUri);
        }
예제 #11
0
        private string GetContent(TemplateEmail templateEmail, IEmployer employer, MemberSearch search, MemberSearchResults results, int newCount, int updatedCount, bool useExtraReturn, out int written)
        {
            written = 0;

            var sb = new StringBuilder();

            sb.AppendLine("<p>");
            sb.AppendLine();
            sb.AppendLine();
            sb.Append("  <strong>" + results.TotalMatches + " candidate");

            if (results.TotalMatches != 1)
            {
                sb.Append("s");
                sb.AppendFormat(" ({0} new and {1} updated)", newCount, updatedCount);
            }

            sb.Append("</strong>");
            sb.Append(results.TotalMatches != 1 ? " were" : " was");
            sb.Append(" found");

            var criteriaText = GetCriteriaText(search.Criteria);

            if (string.IsNullOrEmpty(criteriaText))
            {
                sb.AppendLine();
            }
            else
            {
                sb.AppendLine(" for: " + criteriaText);
            }
            sb.AppendLine();
            sb.AppendLine();
            sb.AppendLine("</p>");
            sb.AppendLine();

            // Results.

            var header = GetHeader(results);

            if (!string.IsNullOrEmpty(header))
            {
                sb.AppendLine("<p>");
                sb.AppendLine("  " + header);
                sb.AppendLine("</p>");
                sb.AppendLine("<p>");
                sb.Append(GetResults(templateEmail, employer, results, useExtraReturn, ref written));
                sb.AppendLine("</p>");
                sb.AppendLine();
            }

            var tinyUrl = GetTinyUrl(templateEmail, true, "~/employers/login", "returnUrl", new ReadOnlyApplicationUrl("~/ui/registered/employers/SavedResumeSearchAlerts.aspx").PathAndQuery);

            sb.AppendLine("<p>");
            sb.AppendLine("  Edit your daily candidate alerts");
            sb.AppendLine("  <a href=\"" + tinyUrl + "\">here.</a>");
            sb.AppendLine("</p>");
            sb.AppendLine("<!-- Saved resume search " + search.Id.ToString("B") + " -->");
            return(sb.ToString());
        }
예제 #12
0
        protected override void GetMemberSignature(TemplateEmail email, StringBuilder sb)
        {
            switch (_activeCommunity)
            {
            case ActiveCommunity.Monash:
                sb.AppendLine("        <br />Thanks,");
                sb.AppendLine("        <br />Your Career Networking team");
                sb.AppendLine("        <br />");
                sb.AppendLine("        <br />For support please");
                sb.AppendLine("        <a href=\"" + GetTinyUrl(email, false, "~/contactus") + "\">contact us</a>.");
                sb.AppendLine("        <p>This service brought to you by</p>");
                sb.AppendLine("        <p>");
                sb.AppendLine("          <img src=\"" + InsecureRootPath + "email/logo-for-emails.gif\" alt=\"LinkMe\" />");
                sb.AppendLine("        </p>");
                break;

            case ActiveCommunity.Finsia:
                sb.AppendLine("        <p>This service is provided by");
                sb.AppendLine("          <img src=\"" + InsecureRootPath + "email/logo-for-emails.gif\" alt=\"LinkMe\" />");
                sb.AppendLine("        </p>");
                sb.AppendLine("        <p>");
                sb.AppendLine("          Copyright 2008 Finsia - Financial Services Institute of Australasia.");
                sb.AppendLine("          All rights reserved");
                sb.AppendLine("        </p>");
                break;

            default:
                base.GetMemberSignature(email, sb);
                break;
            }
        }
예제 #13
0
        private static void GetBodyEnd(TemplateEmail email, StringBuilder sb)
        {
            sb.AppendLine("      </div>");

/*
 *          sb.AppendLine("      <div class=\"signature\">");
 *          GetSignature(sb);
 *          sb.AppendLine("      </div>");
 *          sb.AppendLine();
 *          sb.AppendLine("      <div class=\"unsubscribe\">");
 *          sb.AppendLine("        <p>");
 *          sb.AppendLine("          Receiving too many emails?");
 *          sb.AppendLine("          <br />");
 *          sb.AppendLine("          <a href=\"" + GetTinyUrl(email, true, "~/members/settings") + "\">");
 *          sb.AppendLine("            Click here");
 *          sb.AppendLine("          </a>");
 *          sb.AppendLine("          to log in to manage the amount of emails you receive from us.");
 *          sb.AppendLine("        </p>");
 *          sb.AppendLine("        <p>");
 *          sb.AppendLine("          Alternatively, if you're sure you wish to unsubscribe from this type of");
 *          sb.AppendLine("          email completely,");
 *          sb.AppendLine("          <a href=\"" + GetTinyUrl(email, false, "~/accounts/settings/unsubscribe", "userId", email.To.Id.ToString("n"), "category", "Campaign") + "\">");
 *          sb.AppendLine("            click here");
 *          sb.AppendLine("          </a>.");
 *          sb.AppendLine("        </p>");
 *          sb.AppendLine("      </div>");
 *          sb.AppendLine();
 */
            sb.AppendLine("    </div>");
            sb.AppendLine("    <img src=\"" + GetTrackingPixelUrl(email) + "\" width=\"1\" height=\"1\" />");
            sb.AppendLine("  </body>");
            sb.AppendLine("</html>");
        }
예제 #14
0
        protected override void GetMemberSignature(TemplateEmail email, StringBuilder sb)
        {
            switch (_activeCommunity)
            {
            case ActiveCommunity.LiveInAustralia:
                sb.AppendLine("        <p>Cheers,</p>");
                sb.AppendLine("        <p>Peter,<br />Live In Australia</p>");
                sb.AppendLine("        <p>Provided by <img src=\"" + InsecureRootPath + "email/logo-for-emails.gif\" alt=\"LinkMe\" /></p>");
                break;

            case ActiveCommunity.Finsia:
                sb.AppendLine("        <p>Cheers,</p>");
                sb.AppendLine("        <p>");
                sb.AppendLine("          The Finsia Career Network team.<br />");
                sb.AppendLine("          <a href=\"mailto:[email protected]\">[email protected] </a>");
                sb.AppendLine("        </p>");
                sb.AppendLine("      </div>");
                sb.AppendLine("      <div class=\"body\">      </div>");
                sb.AppendLine("      <div class=\"signature\" style=\"padding-left: 9px; font-family: Arial, Helvetica, sans-serif; color: gray; font-size: 9pt; padding-top:1em;\">");
                sb.AppendLine("        <p>This service is provided by");
                sb.AppendLine("          <img src=\"" + InsecureRootPath + "email/logo-for-emails.gif\" alt=\"LinkMe\" />");
                sb.AppendLine("        </p>");
                sb.AppendLine("        <p>");
                sb.AppendLine("          Copyright 2008 Finsia - Financial Services Institute of Australasia.");
                sb.AppendLine("          All rights reserved");
                sb.AppendLine("        </p>");
                break;

            default:
                base.GetMemberSignature(email, sb);
                break;
            }
        }
예제 #15
0
        private string GetContent(TemplateEmail templateEmail, ICommunicationRecipient employer, int quantity)
        {
            var sb = new StringBuilder();

            sb.AppendLine("<p>Hi " + employer.FirstName + "</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  Thank you for using LinkMe for your candidate sourcing");
            sb.AppendLine("  - our records show that you have " + quantity + " credits left in your account.");
            sb.AppendLine("</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  This is just a reminder to plan your next purchase of candidate contact credits");
            sb.AppendLine("  for continued access to LinkMe's resume database candidates.");
            sb.AppendLine("  To purchase more credits,");
            sb.AppendLine("  <a href=\"" + GetTinyUrl(templateEmail, true, "~/employers/products/neworder") + "\">click here</a>");
            sb.AppendLine("  to login and use our secure credit card transaction process.");
            sb.AppendLine("</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  Did you know that LinkMe offers subscriptions for unlimited access");
            sb.AppendLine("  to the resume database for larger volume users?");
            sb.AppendLine("  Call us on 1800 546 563 to find out how an annual subscription to LinkMe may");
            sb.AppendLine("  be more cost effective for your organisation.");
            sb.AppendLine("</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  We look forward to seeing you on our site again soon.");
            sb.AppendLine("</p>");
            return(sb.ToString());
        }
예제 #16
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void Page_Load([NotNull] object sender, [NotNull] EventArgs e)
        {
            if (!this.Get <HttpRequestBase>().QueryString.Exists("t") || !this.PageContext.ForumReadAccess ||
                !this.PageContext.BoardSettings.AllowEmailTopic)
            {
                BuildLink.AccessDenied();
            }

            if (this.IsPostBack)
            {
                return;
            }

            this.PageContext.PageElements.RegisterJsBlockStartup(
                nameof(JavaScriptBlocks.FormValidatorJs),
                JavaScriptBlocks.FormValidatorJs(this.SendEmail.ClientID));

            this.Subject.Text = this.PageContext.PageTopicName;

            var emailTopic = new TemplateEmail
            {
                TemplateParams =
                {
                    ["{link}"] = BuildLink.GetLink(
                        ForumPages.Posts,
                        true,
                        "t={0}&name={1}",
                        this.PageContext.PageTopicID,
                        this.PageContext.PageTopicName),
                    ["{user}"] = this.Get <IUserDisplayName>().GetName(this.PageContext.User)
                }
            };

            this.Message.Text = emailTopic.ProcessTemplate("EMAILTOPIC");
        }
예제 #17
0
        private string GetContent(TemplateEmail templateEmail, ICommunicationRecipient member, EmailVerification emailVerification)
        {
            var sb = new StringBuilder();

            sb.AppendLine("<p>Dear " + member.FirstName + ",</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  In order to protect your privacy");
            sb.AppendLine("  we need you to verify that the email address you have supplied is correct.");
            sb.AppendLine("</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  More importantly, employers may not be able to send possible job opportunities");
            sb.AppendLine("  to you if your email address is not verified.");
            sb.AppendLine("</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  <a href=\"" + GetTinyUrl(templateEmail, 0, false, "~/accounts/verification", "verificationCode", emailVerification.VerificationCode) + "\">");
            sb.AppendLine("    Please verify your email address now");
            sb.AppendLine("  </a>");
            sb.AppendLine("</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  If this link doesn't work, please copy and paste the following link");
            sb.AppendLine("  into your browser:");
            sb.AppendLine("  <a href=\"" + GetTinyUrl(templateEmail, 1, false, "~/accounts/verification", "verificationCode", emailVerification.VerificationCode) + "\">");
            sb.AppendLine("    " + GetTinyUrl(templateEmail, 2, false, "~/accounts/verification", "verificationCode", emailVerification.VerificationCode));
            sb.AppendLine("  </a>");
            sb.AppendLine("</p>");
            return(sb.ToString());
        }
예제 #18
0
        private CopyItem GetCopyItem(TemplateEmail email, Guid?affiliateId, TemplateContentItem templateContentItem, IDictionary <Guid, CopyItemEngine> copyItemEngines)
        {
            // Check the collection first.

            CopyItemEngine copyItemEngine;

            if (!copyItemEngines.TryGetValue(affiliateId ?? Guid.Empty, out copyItemEngine))
            {
                // Get a new one.

                templateContentItem.VerticalId = affiliateId;
                copyItemEngine = _templateEngine.GetCopyItemEngine(templateContentItem);
                copyItemEngines[affiliateId ?? Guid.Empty] = copyItemEngine;
            }

            // Query the template engine for the copy.

            var context = new TemplateContext {
                Id = email.Id, UserId = email.To.Id
            };
            var item = _templateEngine.GetCopyItem(copyItemEngine, context, email.Properties, null);

            if (item == null)
            {
                throw new ApplicationException("Failed to find a copy item for '" + email.Definition + "'.");
            }
            return(item);
        }
        private string GetBody(TemplateEmail templateEmail, Member member, IEmployer employer, string content)
        {
            var view = _employerMemberViewsQuery.GetEmployerMemberView(employer, member);

            // Autopeople specific.

            var sb = new StringBuilder();

            GetBodyStart(sb);
            sb.AppendLine("Please find a copy of the email you sent to");
            sb.AppendLine(view.GetDisplayText(true));
            sb.AppendLine("on the " + DateTime.Now.ToShortDateString() + ".");
            sb.AppendLine("<br /><br />-------- Original Message --------");
            sb.AppendLine("<br />" + content);
            sb.AppendLine("<br />");
            sb.AppendLine("      </div>");
            sb.AppendLine("      <div class=\"signature\" style=\"padding-left: 9px; font-family: Arial, Helvetica, sans-serif; color: gray; font-size: 9pt; padding-top:1em;\">");
            sb.AppendLine("        --------------------<br />");
            sb.AppendLine("        Kind regards, <br />");
            sb.AppendLine("        Autopeople resume search (powered by LinkMe) <br />");
            sb.AppendLine("        _____________________________________________<br />");
            sb.AppendLine("        Autopeople <a href=\"http://www.autopeople.com.au\">www.autopeople.com.au</a>");
            sb.AppendLine("        <br />");
            sb.AppendLine("        Tel:+61 3 9614 0066  |  Fax: +61 3 9533 7224<br />");
            sb.AppendLine("        2nd Floor, 470 Collins Street, Melbourne Vic 3000<br />");
            sb.AppendLine("        <br />");
            sb.AppendLine("        <i>real <b>jobs</b> for real <b>auto</b> people</i><br />");
            sb.AppendLine("        <br />");
            sb.AppendLine("        <br />");
            sb.AppendLine("        To update your details, log in to your");
            sb.AppendLine("        <a href=\"http://www.autopeople.com.au\">Autopeople account</a>");
            sb.AppendLine("        <br />");
            GetBodyEnd(templateEmail, sb);
            return(sb.ToString());
        }
예제 #20
0
        private string GetContent(TemplateEmail templateEmail, ICommunicationRecipient member)
        {
            var sb = new StringBuilder();

            sb.AppendLine("<p>");
            sb.AppendLine("  Dear " + member.FirstName + ",");
            sb.AppendLine("</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  Your work status on LinkMe has been changed from 'Immediately Available' to 'Actively Looking for Work'.");
            sb.AppendLine("  This means that when employers find your resume,");
            sb.AppendLine("  they may assume that though you are looking for work,");
            sb.AppendLine("  you may need to provide a notice period to your current employer.");
            sb.AppendLine("</p>");
            sb.AppendLine("<p>");
            sb.AppendLine("  If this is not accurate, you can");
            sb.AppendLine("  <a href=\"" + GetTinyUrl(templateEmail, true, "~/members/profile/status/update") + "\">change your work status</a>");
            sb.AppendLine("  to:");
            sb.AppendLine("</p>");
            sb.AppendLine("<ol>");
            sb.AppendLine("  <li>'Immediately Available', or<p /></li>");
            sb.AppendLine("  <li>'Not Looking but Happy to Talk', or<p /></li>");
            sb.AppendLine("  <li>'Not Looking for Work'</li>");
            sb.AppendLine("</ol>");
            sb.AppendLine("<p>");
            sb.AppendLine("  Please note that if you indicate that you are Immediately Available");
            sb.AppendLine("  or Actively Looking for Work,");
            sb.AppendLine("  your status will have to be confirmed regularly.");
            sb.AppendLine("</p>");
            return(sb.ToString());
        }
예제 #21
0
        /// <summary>
        /// Send an Private Message to the Newly Created User with
        /// his Account Info (Pass, Security Question and Answer)
        /// </summary>
        /// <param name="user">
        /// The user.
        /// </param>
        /// <param name="pass">
        /// The pass.
        /// </param>
        /// <param name="userId">
        /// The user Id.
        /// </param>
        private void SendRegistrationMessageToTwitterUser(
            [NotNull] AspNetUsers user,
            [NotNull] string pass,
            [NotNull] int userId)
        {
            var subject = string.Format(
                BoardContext.Current.Get <ILocalization>().GetText("COMMON", "NOTIFICATION_ON_NEW_FACEBOOK_USER_SUBJECT"),
                BoardContext.Current.Get <BoardSettings>().Name);

            var notifyUser = new TemplateEmail
            {
                TemplateParams =
                {
                    ["{user}"]      = user.UserName,
                    ["{email}"]     = user.Email,
                    ["{pass}"]      = pass,
                    ["{forumname}"] = BoardContext.Current.Get <BoardSettings>().Name
                }
            };

            var emailBody = notifyUser.ProcessTemplate("NOTIFICATION_ON_TWITTER_REGISTER");

            var messageFlags = new MessageFlags {
                IsHtml = false, IsBBCode = true
            };

            // Send Message also as DM to Twitter.
            this.GetRepository <PMessage>().SendMessage(2, userId, subject, emailBody, messageFlags.BitValue, -1);
        }
예제 #22
0
        private string GetContent(TemplateEmail templateEmail, string messageText, JobAdEntry ad)
        {
            var builder = new StringBuilder();

            builder.AppendLine("<p>Hi " + RecipientDisplayName + "</p>");
            builder.AppendLine("<p>");
            builder.AppendLine("  " + SenderDisplayName + " has found an interesting job ");
            builder.AppendLine("  opportunity and thought that you should see it.");
            builder.AppendLine("</p>");
            builder.AppendLine();

            if (!string.IsNullOrEmpty(messageText))
            {
                builder.AppendLine("<p>");
                builder.AppendLine("  " + SenderDisplayName + "'s personal message:");
                builder.AppendLine("  <br />");
                builder.AppendLine("  " + messageText);
                builder.AppendLine("</p>");
                builder.AppendLine();
            }

            builder.AppendLine("<p>");
            builder.AppendLine("  View the ");
            builder.AppendLine("  <a href=\"" + GetTinyUrl(templateEmail, false, "~/jobs/" + ad.Id) + "\">" + ad.Title + "</a>");
            builder.AppendLine("  job and apply now.");
            builder.AppendLine("</p>");
            return(builder.ToString());
        }
예제 #23
0
        /// <summary>
        /// Send an Private Message to the Newly Created User with
        /// his Account Info (Pass, Security Question and Answer)
        /// </summary>
        /// <param name="user">
        /// The user.
        /// </param>
        /// <param name="pass">
        /// The pass.
        /// </param>
        /// <param name="securityAnswer">
        /// The security answer.
        /// </param>
        /// <param name="userId">
        /// The user Id.
        /// </param>
        /// <param name="oAuth">
        /// The oAUTH.
        /// </param>
        private static void SendRegistrationMessageToTwitterUser(
            [NotNull] MembershipUser user,
            [NotNull] string pass,
            [NotNull] string securityAnswer,
            [NotNull] int userId,
            OAuthTwitter oAuth)
        {
            var subject = string.Format(
                YafContext.Current.Get <ILocalization>().GetText("COMMON", "NOTIFICATION_ON_NEW_FACEBOOK_USER_SUBJECT"),
                YafContext.Current.Get <BoardSettings>().Name);

            var notifyUser = new TemplateEmail
            {
                TemplateParams =
                {
                    ["{user}"]      = user.UserName,
                    ["{email}"]     = user.Email,
                    ["{pass}"]      = pass,
                    ["{answer}"]    = securityAnswer,
                    ["{forumname}"] = YafContext.Current.Get <BoardSettings>().Name
                }
            };


            var emailBody = notifyUser.ProcessTemplate("NOTIFICATION_ON_TWITTER_REGISTER");

            var messageFlags = new MessageFlags {
                IsHtml = false, IsBBCode = true
            };

            // Send Message also as DM to Twitter.
            var tweetApi = new TweetAPI(oAuth);

            var message = $"{subject}. {YafContext.Current.Get<ILocalization>().GetText("LOGIN", "TWITTER_DM")}";

            if (YafContext.Current.Get <BoardSettings>().AllowPrivateMessages)
            {
                YafContext.Current.GetRepository <PMessage>().SendMessage(2, userId, subject, emailBody, messageFlags.BitValue, -1);
            }
            else
            {
                message = YafContext.Current.Get <ILocalization>()
                          .GetTextFormatted(
                    "LOGIN",
                    "TWITTER_DM_ACCOUNT",
                    YafContext.Current.Get <BoardSettings>().Name,
                    user.UserName,
                    pass);
            }

            try
            {
                tweetApi.SendDirectMessage(TweetAPI.ResponseFormat.json, user.UserName, message.Truncate(140));
            }
            catch (Exception ex)
            {
                YafContext.Current.Get <ILogger>().Error(ex, "Error while sending Twitter DM Message");
            }
        }
예제 #24
0
 protected void GetBodyEnd(TemplateEmail email, StringBuilder sb)
 {
     sb.AppendLine("      </div>");
     sb.AppendLine("    </div>");
     sb.AppendLine("    <img src=\"" + GetTrackingPixelUrl(email) + "\" width=\"1\" height=\"1\" />");
     sb.AppendLine("  </body>");
     sb.AppendLine("</html>");
 }
예제 #25
0
 protected override void GetClientSignature(TemplateEmail email, StringBuilder sb)
 {
     sb.AppendLine("        <p>Kind regards,</p>");
     sb.AppendLine("        <p>Monash Business and Economics Career Services.</p>");
     sb.AppendLine("        <p>");
     sb.AppendLine("          <img src=\"" + InsecureRootPath + "themes/communities/monash/gsb/img/email-logo.jpg\" alt=\"Monash Business and Economics\" />");
     sb.AppendLine("        </p>");
 }
예제 #26
0
 protected virtual void GetPlainMemberSignature(TemplateEmail email, StringBuilder sb)
 {
     sb.AppendLine("Thanks,");
     sb.AppendLine("Your LinkMe team");
     sb.AppendLine();
     sb.AppendLine("For support please contact us here");
     sb.AppendLine(GetTinyUrl(email, "text/plain", false, "~/contactus"));
 }
예제 #27
0
        protected string GetTinyUrl(TemplateEmail email, string mimeType, int instance, bool secure, string applicationPath, QueryString queryString)
        {
            var url         = new ApplicationUrl(applicationPath, queryString);
            var affiliateId = _affiliateEmailsQuery.GetAffiliateId(email);
            var mappings    = _tinyUrlQuery.GetMappings(WebSite.LinkMe, affiliateId, secure, url.IsAbsolute ? url.AbsoluteUri : "~" + url.AppRelativePathAndQuery, email.Id, mimeType, instance);

            return(mappings.Count == 0 ? null : _webSiteQuery.GetUrl(WebSite.LinkMe, affiliateId, false, "~/url/" + mappings[0].TinyId.ToString("n")).AbsoluteUri);
        }
예제 #28
0
        protected virtual ICollection <Email> FormatarEmailPadrao(TemplateEmail templateEmail, string destinatarios)
        {
            var mensagem = SubstituirParametrosTemplate(templateEmail.Template);

            return(new List <Email> {
                new Email(destinatarios, null, templateEmail.Assunto, mensagem)
            });
        }
예제 #29
0
        protected string GetPlainBody(TemplateEmail email, bool includeSignature, string content)
        {
            var sb = new StringBuilder();

            GetPlainBodyStart(sb);
            sb.Append(content);
            GetPlainBodyEnd(email, includeSignature, sb);
            return(sb.ToString());
        }
예제 #30
0
        public override ICollection <Email> FormatarEmails()
        {
            var templateEmail = new TemplateEmail(ETipoTemplateEmail.CadastroSESMT, "[CIPA] Acesso ao Sistema")
            {
                Template = mensagemCadastroSESMT
            };

            return(FormatarEmailPadrao(templateEmail, Usuario.Email));
        }