Ecodev / newsletter

TYPO3 extension to send newsletter
https://extensions.typo3.org/extension/newsletter/
25 stars 26 forks source link

Implement a request variable to signify when you are sending test mails. #135

Closed marvin-martian closed 7 years ago

marvin-martian commented 7 years ago

If you send a request variable to signify that you are rendering a test mail, we can use that variable to mark in the mail content that this is only a test newsletter! This might also be helpful if you accidentally send a test mail to the wrong recipients! touch wood

Ecodev\Newsletter\Domain\Model\Newsletter->getContentUrl
......
    /**
     * Returns the URL of the content of this newsletter
     * @return string
     */
    public function getContentUrl($language = null)
    {
        $append_url = Tools::confParam('append_url');
        $baseUrl = $this->getBaseUrl();

        if (!is_null($language) && $language !== '') {
            $language = '&L=' . $language;
        }

        $test = '';
        if ($this->getIsTest()) {
            $test = '&tx_newsletter_test=1';
        }

        return $baseUrl . '/index.php?id=' . $this->getPid() . $language . $test . $append_url;
    }
PowerKiKi commented 7 years ago

You can do that with an appropriate RecipientList that contains whatever custom field that you need. IMHO there is not need to add a new mechanism.

marvin-martian commented 7 years ago

I dont really understand what you mean. If you accidently send a test mailing to the wrong recipient list, how exactly does the template distinguish that this is a test sending or not? It is not determined by the recipients, but is determined by whether or not you pressed "Send test emails now"

PowerKiKi commented 7 years ago

You are correct that it does not help if it's the wrong recipient list. But at this point nothing can help you much. Selecting the recipient list is a critical step and should be done with extreme care.

marvin-martian commented 7 years ago

Well a flag to signal it is a test mail creates an opportunity to add text to the test mail that says something along the lines of "This is a test mail, if you have recieved this mail in error please ignore." It gives at least some sort of catch explanation of an accidental send. The selection of the recipient list is critical, but I have users that will make such mistakes, regardless of how often I show them how to use the tool. In fact I had such a case where they thought they had to add the final recipient list to the test sending to test whether or not the users would get the mail. So I am trying to make it as idiot proof as possible.