<commit_before>﻿@*
    Testing sending email using LcMessaging API, to try find
    the problem with duplicated sents, issue #176
*@

@{
    LcHelpers.TestArea();
    Layout = "_TestLayout.cshtml";
    
    float delay = Request["delayMinutes"].AsFloat(0);
    var to = Request["to"] ?? "<EMAIL>";
    var subject = "LC Test Email: ";
    var q = Request["q"].AsInt(20);
    var series = Request["series"] ?? "A";

    for (var i = 1; i <= q; i++) {
        var stime = " ::T::" + DateTime.Now.ToLongTimeString();
        if (delay > 0) {
            LcMessaging.SendMailDelayed(TimeSpan.FromMinutes((double)delay),
                to, subject + series + i.ToString() + stime, "Testing Sending Email");
        } else {
            LcMessaging.SendMail(
                to, subject + series + i.ToString() + stime, "Testing Sending Email");
        }
    }
}

    <h1>Testing sending emails</h1>
    <p>
        @if (delay > 0) {
            <span>Emails was scheduled to be sent</span>
        } else {
            <span>Emails was sent</span>
        }
    </p><commit_msg>Enhanced Test of send batch of emails for more versatil and easy use, to test problems with emails #219<commit_after>﻿@*
    Testing sending email using LcMessaging API, to try find
    the problem with duplicated sents, issue #176
*@

@{
    LcHelpers.TestArea();
    Layout = "_TestLayout.cshtml";
    
    float delay = Request["delayMinutes"].AsFloat(0);
    var to = Request["to"] ?? "<EMAIL>";
    var subject = "LC Test Email: ";
    var q = Request["q"].AsInt(0);
    var series = Request["series"] ?? "A";
    var body = Request["body"] ?? "Testing Sending Email";

    for (var i = 1; i <= q; i++) {
        var stime = " ::T::" + DateTime.Now.ToLongTimeString();
        if (delay > 0) {
            LcMessaging.SendMailDelayed(TimeSpan.FromMinutes((double)delay),
                to, subject + series + i.ToString() + stime, body);
        } else {
            LcMessaging.SendMail(
                to, subject + series + i.ToString() + stime, body);
        }
    }
}

    <h1>Testing sending emails</h1>
    @if (q > 0)
    {
        <p>
            @if (delay > 0)
            {
                <strong>Emails was scheduled to be sent</strong>
            }
            else
            {
                <strong>Emails was sent</strong>
            }
        </p>
    }
    <form method="get">
        <fieldset>
            <legend>Send a batch of emails: </legend>
            <ul>
                <li><label>Quantity of messages in the batch: <input type="text" name="q" value="@q" /></label></li>
                <li><label>To: <input type="text" name="to" value="@to" /></label></li>
                <li><label>Subject: "@subject <em>series</em> ::T::<em>server time</em>"</label></li>
                <li><label>Series: <input type="text" name="series" value="@series" /></label></li>
                <li><label>Delay in minutes: <input type="text" name="delayMinutes" value="@delay" /></label></li>
                <li><label>Message body: <textarea style="resize: both" rows="5" cols="80" name="body">@body</textarea></label></li>
                <li class="actions">
                    <input type="submit" class="main-action action" value="Send" />
                </li>
            </ul>
        </fieldset>
    </form>
{'fraction_non_alphanumeric': 0.16104756170981335, 'fraction_numerical': 0.008428657435279952, 'mean_word_length': 2.0570377184912605, 'pattern_counts': {'":': 0, '<': 68, '<?xml version=': 0, '>': 71, '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': '5198139', 'n_tokens_mistral': 1062, 'n_tokens_neox': 1007, 'n_words': 267}