Feature #12344

Migrate to t3lib_htmlmail to SwiftMailer

Added by Ernesto Baschny almost 9 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Should have
Category:
Linkvalidator
Target version:
-
Start date:
2011-01-18
Due date:
2011-01-19
% Done:

100%

PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

We have a new Mailer API in 4.5 based on SwiftMailer and we want to deprecate the use of t3lib_htmlmail. Which means we need to get rid of it all together.

Attached is an untested patch of what this would mean more or less for "linkvalidator". Please take a look at it, test it, and integrate that solution for the RC1 if possible.

See pending documentation at http://wiki.typo3.org/Pending_Documentation#t3lib_mail

Thanks!

linkvalidator-swiftmailer.diff View (1.98 KB) Ernesto Baschny, 2011-01-18 09:09

linkvalidator-swiftmailer_v2.diff View (5.75 KB) Michael Miousse, 2011-01-19 16:30

linkvalidator-swiftmailer_v3.diff View (5.68 KB) Chris topher, 2011-01-19 21:00

linkvalidator-swiftmailer_v4.diff View (2 KB) Michael Miousse, 2011-01-19 22:05

linkvalidator-swiftmailer_v5.diff View (2.01 KB) Michael Miousse, 2011-01-19 22:42

linkvalidator-swiftmailer_v6.diff View (1.91 KB) Michael Miousse, 2011-01-19 22:51


Related issues

Related to TYPO3 Core - Bug #12261: Reports are not sending correct emails Closed 2011-01-15
Duplicates TYPO3 Core - Feature #11276: Use the new mail API for the scheduler mail Closed 2010-12-03

Associated revisions

Revision a3d3ec36 (diff)
Added by Chris topher almost 9 years ago

Followup to bug #12344: Updated the manual for using the SwiftMailer

git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/linkvalidator/trunk@42363 735d13b6-9817-0410-8766-e36946ffe9aa

History

#1 Updated by Michael Miousse almost 9 years ago

Here is a tested version 2 of the patch with validations and error messages.
Need someone to double check the messages and double test it.

#2 Updated by Michael Miousse almost 9 years ago

  • Status changed from Needs Feedback to Closed

#3 Updated by Michael Miousse almost 9 years ago

  • Status changed from Closed to Needs Feedback

sorry i thoutgh it would only close 11276

#4 Updated by Chris topher almost 9 years ago

Looks good. I did some reformatting of the code and changed some texts.

If everything is OK, you can commit this one.

We will also have to update the manual. I will then take care of that after the commit.

#5 Updated by Michael Miousse almost 9 years ago

  • Status changed from Needs Feedback to Resolved

Committed revision 42362.

#6 Updated by Chris topher almost 9 years ago

  • Assignee set to Michael Miousse
  • % Done changed from 0 to 100

I updated the manual.

Committed in r42363.

#7 Updated by Ernesto Baschny almost 9 years ago

Nice work!

About this snippet(s):

   $failure = t3lib_div::makeInstance(
        'Exception',
$GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.error.invalidFromEmail'),
        t3lib_FlashMessage::ERROR
    );
    throw $failure;
    $sendEmail = FALSE;

1) throughout the core we usually use "throw new Exception()" syntax (no t3lib_div::makeInstance and no variable holding the exception before throwing it. Reasoning is that an exception should be thrown without relying on any other classes.

2) The second parameter of the Exception is not the FlashMessage Error-Code, but a unique unix timestamp (the time when you created the error message), so that we can differenciate different exceptions later on based on that information.

3) $sendEmail is never reached, so can also be removed (its shown as a "warning" in PhpStorm)

Could you adapt that still? Thanks!

#8 Updated by Michael Miousse almost 9 years ago

Will do

#10 Updated by Chris topher almost 9 years ago

The timestamp should be the time from now. Just as a hardcoded string like: 1295471588

But use 3 different timestamps for the 3 different messages.

#11 Updated by Michael Miousse almost 9 years ago

Christopher wrote:

The timestamp should be the time from now. Just as a hardcoded string like: 1295471588

But use 3 different timestamps for the 3 different messages.

time() is not good?

#12 Updated by Chris topher almost 9 years ago

Michael Miousse wrote:

time() is not good?

No, because the timestamp should be used to identify each error message. Therefore it must always be the same for the same message (but different for every other message).

#13 Updated by Michael Miousse almost 9 years ago

okay here it is

#14 Updated by Michael Miousse almost 9 years ago

Michael Miousse wrote:

okay here it is

sorry i forgot to erase path from the patch

#16 Updated by Michael Miousse almost 9 years ago

Committed revision 42365.

#17 Updated by Chris topher over 7 years ago

  • Status changed from Resolved to Closed

#18 Updated by Michael Stucki almost 6 years ago

  • Category set to Linkvalidator

#19 Updated by Michael Stucki almost 6 years ago

  • Project changed from Linkvalidator to TYPO3 Core
  • Category changed from Linkvalidator to Linkvalidator

Also available in: Atom PDF