<commit_before>﻿@{
    LcHelpers.TestArea();
    Layout = "_TestLayout.cshtml";

    if (IsPost)
    {
        var url = Request["url"].Replace(LcUrl.SiteUrl, "");
        LcMessaging.SendMail(Request["email"], "Testing Email " + url,
            LcMessaging.ApplyTemplate(url, null));
    }

    var list = new Dictionary<string, List<string>>{
        { "[needs review] EmailInquiry", new List<string> {
            "Email/EmailInquiry/?ThreadID=13&MessageID=26&Kind=-1&RequestKey=abcd3&EmailTo=<EMAIL>"
            ,"Email/EmailInquiry/?ThreadID=13&MessageID=26&Kind=2&RequestKey=abcd3&EmailTo=<EMAIL>"} }
        ,{ "[needs review] EmailProviderReference", new List<string> { "Email/EmailProviderReference/?UserID=141&PositionID=14&RequestKey=abcd3&EmailTo=<EMAIL>" } }
        
        ,{ "Welcome", new List<string> {
            "EmailCommunications/Admin/ToClient/Welcome?UserID=141&RequestKey=abcd3"
            ,"EmailCommunications/Admin/ToServiceProfessional/Welcome?UserID=141&RequestKey=abcd3"
        } }
        ,{ "ResetPassword", new List<string> {
            "EmailCommunications/Admin/ToClient/ResetPassword?UserID=141&RequestKey=abcd3"
            ,"EmailCommunications/Admin/ToServiceProfessional/ResetPassword?UserID=141&RequestKey=abcd3"
        } }
        ,{ "Admin/ToServiceProfessional (remaining templates)", new List<string> {
            "EmailCommunications/Admin/ToServiceProfessional/BackgroundCheckRequestReceived?UserID=141&RequestKey=abcd3"
            ,"EmailCommunications/Admin/ToServiceProfessional/OptionalCertificationVerificationRequestReceived?UserID=141&jobTitleID=106&RequestKey=abcd3"
            ,"EmailCommunications/Admin/ToServiceProfessional/OwnerInvitation?UserID=141&RequestKey=abcd3"
            ,"EmailCommunications/Admin/ToServiceProfessional/RequiredLicenseVerificationRequestReceived?UserID=141&jobTitleID=106&RequestKey=abcd3"
        } }

        ,{ "Admin/Internal", new List<string> {
            "EmailCommunications/Admin/Internal/EmailBackgroundCheckRequest/?userID=141&jobTitleID=14&backgroundCheckID=1&RequestKey=abcd3"
            ,"EmailCommunications/Admin/Internal/EmailLicenseVerificationRequest/?userID=141&jobTitleID=14&licenseCertificationID=18&RequestKey=abcd3"
            ,"EmailCommunications/Admin/Internal/EmailProviderPaymentAccountNotification/?userID=141&RequestKey=abcd3"
            ,"EmailCommunications/Admin/Internal/EmailReportUnauthorizedUse/?ReportedUserID=141&ReportedByUserID=141&Message=Reporting+some+problem&RequestKey=abcd3"
        } }
    };

    // Booking Template Names for new EmailCommunications
    var bookingBookNowClient = new string[] {
        "BookingCancelledByClient",
        "BookingCancelledByServiceProfessional",
        "BookingReminder",
        "BookingRequestConfirmed",
        "BookingRequestDeclined",
        "BookingRequestExpired",
        "BookingRequestSummary",
        "BookingUpdatedByClient",
        "BookingUpdatedByServiceProfessional",
        "InstantBookingConfirmed",
        "RequestToReview",
        "RequestToReviewReminder"
    };
    var bookingBookNowServiceProfessional = new string[] {
        "BookingCancelledByClient",
        "BookingReminder",
        "BookingRequestConfirmed",
        "BookingRequestExpired",
        "BookingRequestSummary",
        "BookingUpdatedByClient",
        "BookingUpdatedByServiceProfessional",
        "InstantBookingConfirmed"
    };
    var bookingMarketplaceClient = new string[] {
        "BookingCancelledByClient",
        "BookingCancelledByServiceProfessional",
        "BookingReminder",
        "BookingRequestConfirmed",
        "BookingRequestDeclined",
        "BookingRequestExpired",
        "BookingRequestSummary",
        "BookingUpdatedByClient",
        "BookingUpdatedByServiceProfessional",
        "InstantBookingConfirmed",
        "RequestToReview",
        "RequestToReviewReminder"
    };
    var bookingMarketplaceServiceProfessional = new string[] {
        "BookingCancelledByClient",
        "BookingReminder",
        "BookingRequestConfirmed",
        "BookingRequestExpired",
        "BookingRequestSummary",
        "BookingUpdatedByClient",
        "BookingUpdatedByServiceProfessional",
        "InstantBookingConfirmed",
        "RequestToReview",
        "RequestToReviewReminder"
    };
    var bookingServiceProfessionalBookingClient = new string[] {
        "BookingCancelledByClient",
        "BookingCancelledByServiceProfessional",
        "BookingReminder",
        "BookingUpdatedByClient",
        "BookingUpdatedByServiceProfessional",
        "InstantBookingConfirmed",
        "RequestToReview",
        "RequestToReviewReminder"
    };
    var bookingServiceProfessionalBookingServiceProfessional = new string[] {
        "BookingCancelledByClient",
        "BookingUpdatedByClient"
    };
    // Add Booking URLs
    var testBookingID = Request["BookingID"].AsInt(628);
    var isHipaa = Request["hippa"].AsBool();
    var bookingList = new Dictionary<string, List<string>> ();
    bookingList.Add("BOOKING: BookNow ToClient",
        bookingBookNowClient.Select(x => "EmailCommunications/Booking/BookNow/ToClient/" + x + (isHipaa ? "HIPAA" : "") + "?RequestKey=abcd3&BookingID=" + testBookingID).ToList());
    bookingList.Add("BOOKING: BookNow ToServiceProfessional",
        bookingBookNowServiceProfessional.Select(x => "EmailCommunications/Booking/BookNow/ToServiceProfessional/" + x + (isHipaa ? "HIPAA" : "") + "?RequestKey=abcd3&BookingID=" + testBookingID).ToList());
    bookingList.Add("BOOKING: Marketplace ToClient",
        bookingMarketplaceClient.Select(x => "EmailCommunications/Booking/Marketplace/ToClient/" + x + (isHipaa ? "HIPAA" : "") + "?RequestKey=abcd3&BookingID=" + testBookingID).ToList());
    bookingList.Add("BOOKING: Marketplace ToServiceProfessional",
        bookingMarketplaceServiceProfessional.Select(x => "EmailCommunications/Booking/Marketplace/ToServiceProfessional/" + x + (isHipaa ? "HIPAA" : "") + "?RequestKey=abcd3&BookingID=" + testBookingID).ToList());
    bookingList.Add("BOOKING: ServiceProfessionalBooking ToClient",
        bookingServiceProfessionalBookingClient.Select(x => "EmailCommunications/Booking/ServiceProfessionalBooking/ToClient/" + x + (isHipaa ? "HIPAA" : "") + "?RequestKey=abcd3&BookingID=" + testBookingID).ToList());
    bookingList.Add("BOOKING: ServiceProfessionalBooking ToServiceProfessional",
        bookingServiceProfessionalBookingServiceProfessional.Select(x => "EmailCommunications/Booking/ServiceProfessionalBooking/ToServiceProfessional/" + x + (isHipaa ? "HIPAA" : "") + "?RequestKey=abcd3&BookingID=" + testBookingID).ToList());
}
@helper printList(Dictionary<string, List<string>> list)
{
    <ul>
    @foreach (var l in list)
    {
        <li>@l.Key
            <ul>
                @foreach (var l2 in l.Value)
                {
                    <li><a target="_blank" href="@(LcUrl.LangPath + l2)">@l2</a></li>
                }
            </ul>
        </li>
    }
    </ul>
}
<h1>Testing Email Templates along the site</h1>
<h3>Use next links to test every template with some example data in the parameters</h3>
@printList(list)
<h3>Booking emails</h3>
<form action="" method="get">
    <label>Use BookingID: <input type="text" name="BookingID" placeholder="BookingID" /></label>
    <label><input type="checkbox" name="hippa" value="true" /> <span>Use HIPAA templates</span></label>
    <input type="submit" value="APPLY" />
</form>
@printList(bookingList)
<form action="" method="post">
    <h2>Send a testing email:</h2>
    <input type="text" name="url" placeholder="Email template URL" style="width:80%" />
    <input type="text" name="email" placeholder="Email to..." style="width:80%" />
    <input type="submit" value="Send email" style="display:block" />
</form><commit_msg>Minor spelled error on Tests/TestEmails, fixes #882<commit_after>﻿@{
    LcHelpers.TestArea();
    Layout = "_TestLayout.cshtml";

    if (IsPost)
    {
        var url = Request["url"].Replace(LcUrl.SiteUrl, "");
        LcMessaging.SendMail(Request["email"], "Testing Email " + url,
            LcMessaging.ApplyTemplate(url, null));
    }

    var list = new Dictionary<string, List<string>>{
        { "[needs review] EmailInquiry", new List<string> {
            "Email/EmailInquiry/?ThreadID=13&MessageID=26&Kind=-1&RequestKey=abcd3&EmailTo=<EMAIL>"
            ,"Email/EmailInquiry/?ThreadID=13&MessageID=26&Kind=2&RequestKey=abcd3&EmailTo=<EMAIL>"} }
        ,{ "[needs review] EmailProviderReference", new List<string> { "Email/EmailProviderReference/?UserID=141&PositionID=14&RequestKey=abcd3&EmailTo=<EMAIL>" } }
        
        ,{ "Welcome", new List<string> {
            "EmailCommunications/Admin/ToClient/Welcome?UserID=141&RequestKey=abcd3"
            ,"EmailCommunications/Admin/ToServiceProfessional/Welcome?UserID=141&RequestKey=abcd3"
        } }
        ,{ "ResetPassword", new List<string> {
            "EmailCommunications/Admin/ToClient/ResetPassword?UserID=141&RequestKey=abcd3"
            ,"EmailCommunications/Admin/ToServiceProfessional/ResetPassword?UserID=141&RequestKey=abcd3"
        } }
        ,{ "Admin/ToServiceProfessional (remaining templates)", new List<string> {
            "EmailCommunications/Admin/ToServiceProfessional/BackgroundCheckRequestReceived?UserID=141&RequestKey=abcd3"
            ,"EmailCommunications/Admin/ToServiceProfessional/OptionalCertificationVerificationRequestReceived?UserID=141&jobTitleID=106&RequestKey=abcd3"
            ,"EmailCommunications/Admin/ToServiceProfessional/OwnerInvitation?UserID=141&RequestKey=abcd3"
            ,"EmailCommunications/Admin/ToServiceProfessional/RequiredLicenseVerificationRequestReceived?UserID=141&jobTitleID=106&RequestKey=abcd3"
        } }

        ,{ "Admin/Internal", new List<string> {
            "EmailCommunications/Admin/Internal/EmailBackgroundCheckRequest/?userID=141&jobTitleID=14&backgroundCheckID=1&RequestKey=abcd3"
            ,"EmailCommunications/Admin/Internal/EmailLicenseVerificationRequest/?userID=141&jobTitleID=14&licenseCertificationID=18&RequestKey=abcd3"
            ,"EmailCommunications/Admin/Internal/EmailProviderPaymentAccountNotification/?userID=141&RequestKey=abcd3"
            ,"EmailCommunications/Admin/Internal/EmailReportUnauthorizedUse/?ReportedUserID=141&ReportedByUserID=141&Message=Reporting+some+problem&RequestKey=abcd3"
        } }
    };

    // Booking Template Names for new EmailCommunications
    var bookingBookNowClient = new string[] {
        "BookingCancelledByClient",
        "BookingCancelledByServiceProfessional",
        "BookingReminder",
        "BookingRequestConfirmed",
        "BookingRequestDeclined",
        "BookingRequestExpired",
        "BookingRequestSummary",
        "BookingUpdatedByClient",
        "BookingUpdatedByServiceProfessional",
        "InstantBookingConfirmed",
        "RequestToReview",
        "RequestToReviewReminder"
    };
    var bookingBookNowServiceProfessional = new string[] {
        "BookingCancelledByClient",
        "BookingReminder",
        "BookingRequestConfirmed",
        "BookingRequestExpired",
        "BookingRequestSummary",
        "BookingUpdatedByClient",
        "BookingUpdatedByServiceProfessional",
        "InstantBookingConfirmed"
    };
    var bookingMarketplaceClient = new string[] {
        "BookingCancelledByClient",
        "BookingCancelledByServiceProfessional",
        "BookingReminder",
        "BookingRequestConfirmed",
        "BookingRequestDeclined",
        "BookingRequestExpired",
        "BookingRequestSummary",
        "BookingUpdatedByClient",
        "BookingUpdatedByServiceProfessional",
        "InstantBookingConfirmed",
        "RequestToReview",
        "RequestToReviewReminder"
    };
    var bookingMarketplaceServiceProfessional = new string[] {
        "BookingCancelledByClient",
        "BookingReminder",
        "BookingRequestConfirmed",
        "BookingRequestExpired",
        "BookingRequestSummary",
        "BookingUpdatedByClient",
        "BookingUpdatedByServiceProfessional",
        "InstantBookingConfirmed",
        "RequestToReview",
        "RequestToReviewReminder"
    };
    var bookingServiceProfessionalBookingClient = new string[] {
        "BookingCancelledByClient",
        "BookingCancelledByServiceProfessional",
        "BookingReminder",
        "BookingUpdatedByClient",
        "BookingUpdatedByServiceProfessional",
        "InstantBookingConfirmed",
        "RequestToReview",
        "RequestToReviewReminder"
    };
    var bookingServiceProfessionalBookingServiceProfessional = new string[] {
        "BookingCancelledByClient",
        "BookingUpdatedByClient"
    };
    // Add Booking URLs
    var testBookingID = Request["BookingID"].AsInt(628);
    var isHipaa = Request["hipaa"].AsBool();
    var bookingList = new Dictionary<string, List<string>> ();
    bookingList.Add("BOOKING: BookNow ToClient",
        bookingBookNowClient.Select(x => "EmailCommunications/Booking/BookNow/ToClient/" + x + (isHipaa ? "HIPAA" : "") + "?RequestKey=abcd3&BookingID=" + testBookingID).ToList());
    bookingList.Add("BOOKING: BookNow ToServiceProfessional",
        bookingBookNowServiceProfessional.Select(x => "EmailCommunications/Booking/BookNow/ToServiceProfessional/" + x + (isHipaa ? "HIPAA" : "") + "?RequestKey=abcd3&BookingID=" + testBookingID).ToList());
    bookingList.Add("BOOKING: Marketplace ToClient",
        bookingMarketplaceClient.Select(x => "EmailCommunications/Booking/Marketplace/ToClient/" + x + (isHipaa ? "HIPAA" : "") + "?RequestKey=abcd3&BookingID=" + testBookingID).ToList());
    bookingList.Add("BOOKING: Marketplace ToServiceProfessional",
        bookingMarketplaceServiceProfessional.Select(x => "EmailCommunications/Booking/Marketplace/ToServiceProfessional/" + x + (isHipaa ? "HIPAA" : "") + "?RequestKey=abcd3&BookingID=" + testBookingID).ToList());
    bookingList.Add("BOOKING: ServiceProfessionalBooking ToClient",
        bookingServiceProfessionalBookingClient.Select(x => "EmailCommunications/Booking/ServiceProfessionalBooking/ToClient/" + x + (isHipaa ? "HIPAA" : "") + "?RequestKey=abcd3&BookingID=" + testBookingID).ToList());
    bookingList.Add("BOOKING: ServiceProfessionalBooking ToServiceProfessional",
        bookingServiceProfessionalBookingServiceProfessional.Select(x => "EmailCommunications/Booking/ServiceProfessionalBooking/ToServiceProfessional/" + x + (isHipaa ? "HIPAA" : "") + "?RequestKey=abcd3&BookingID=" + testBookingID).ToList());
}
@helper printList(Dictionary<string, List<string>> list)
{
    <ul>
    @foreach (var l in list)
    {
        <li>@l.Key
            <ul>
                @foreach (var l2 in l.Value)
                {
                    <li><a target="_blank" href="@(LcUrl.LangPath + l2)">@l2</a></li>
                }
            </ul>
        </li>
    }
    </ul>
}
<h1>Testing Email Templates along the site</h1>
<h3>Use next links to test every template with some example data in the parameters</h3>
@printList(list)
<h3>Booking emails</h3>
<form action="" method="get">
    <label>Use BookingID: <input type="text" name="BookingID" placeholder="BookingID" /></label>
    <label><input type="checkbox" name="hipaa" value="true" /> <span>Use HIPAA templates</span></label>
    <input type="submit" value="APPLY" />
</form>
@printList(bookingList)
<form action="" method="post">
    <h2>Send a testing email:</h2>
    <input type="text" name="url" placeholder="Email template URL" style="width:80%" />
    <input type="text" name="email" placeholder="Email to..." style="width:80%" />
    <input type="submit" value="Send email" style="display:block" />
</form>
{'fraction_non_alphanumeric': 0.12477684264218311, 'fraction_numerical': 0.013708237694465698, 'mean_word_length': 3.93860201511335, 'pattern_counts': {'":': 0, '<': 101, '<?xml version=': 0, '>': 113, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7529327', 'n_tokens_mistral': 4959, 'n_tokens_neox': 4572, 'n_words': 625}