Development

#3014 (ysfDimensions & sfMail *Success.altbody.php not following set Dimensions)

You must first sign up to be able to contribute.

Ticket #3014 (closed defect: wontfix)

Opened 9 months ago

Last modified 6 months ago

ysfDimensions & sfMail *Success.altbody.php not following set Dimensions

Reported by: DChannon Assigned to: dwhittle
Priority: major Milestone:
Component: plugins Version: 1.0.10
Keywords: ysfDimensions Cc:
Qualification: Unreviewed

Description

When using ysfDimensions with a "mail" module, with actions using sfMail().

The correct template/*Success.php file is used. eg template/*Success.php or template/brand/*Success.php

However for the altbody templates dimensions appears to be ignored: In my specific case I have:

template/brand2/emailSuccess.altbody.php
template/brand2/emailSuccess.php
template/brand3/emailSuccess.altbody.php
template/brand3/emailSuccess.php
template/brand4/emailSuccess.altbody.php
template/brand4/emailSuccess.php
template/emailSuccess.altbody.php
template/emailSuccess.php

When the brand = brand1 - the files used are to create the email are:

template/brand2/emailSuccess.altbody.php
template/emailSuccess.php

It should use files:

template/emailSuccess.altbody.php
template/emailSuccess.php

Change History

02/27/08 19:12:13 changed by dwhittle

  • owner changed from fabien to dwhittle.

Please provide example code as an attachment. Once dimensions are set during sf bootstrap, they can not be changed. Please elaborate on the problem.

02/28/08 09:29:33 changed by DChannon

Hi, Not sure what code I can really provide. There is no attempt to change dimensions after bootstrap.

When the following code is run in a mail module action: /app/frontend/modules/mail/actions/action.class.php

/**
   * Send new password confirmation email to user
   *
   */  
    public function executeSendToUserNewPassword()
    {
      
        $user = $this->getUser();
        $mail = new sfMail();
        $mail->addAddress($user->getAttribute('email'));
        $mail->setFrom(sfConfig::get('app_forgotten_password_from_email'));
        $mail->setSubject(sfConfig::get('app_forgotten_password_subject'));
        $mail->setContentType('text/html');
        $this->mail = $mail;
        $this->password = $user->getAttribute('password');
      
    }

If the dimension is set to "brand1" then the following templates are used in emails:

/app/frontend/modules/mail/templates/brand2/sendToUserNewPasswordSuccess.altbody.php
/app/frontend/modules/mail/templates/sendToUserNewPasswordSuccess/emailSuccess.php

That is wrong - the files used should be -

/app/frontend/modules/mail/templates/sendToUserNewPasswordSuccess.altbody.php
/app/frontend/modules/mail/templates/sendToUserNewPasswordSuccess.php

If the dimension is set to "brand2" then the following files are used:

/app/frontend/modules/mail/templates/brand2/sendToUserNewPasswordSuccess.altbody.php
/app/frontend/modules/mail/templates/brand2/sendToUserNewPasswordSuccess.php

This is correct.

If the dimension is set to "brand3" then the followin files are used:

/app/frontend/modules/mail/templates/brand2/sendToUserNewPasswordSuccess.altbody.php
/app/frontend/modules/mail/templates/brand3/sendToUserNewPasswordSuccess.php

This is wrong both files used should be from "brand3" folder - not one from the brand3 and one from the brand2 folder.

The issue only applies to the "altbody.php" template - not the main template for the action.

The whole dimensions setup deff works - as have 4 brands running from one set of action class's but with different templates. The only bit that does not quite work perfectly is the altbody templates when sending emails - an altbody is included but not from the correct dimension.

It is as though the abltbody file is searched for within the /templates/ folder and sub folders - and the first one that is found is used.

06/11/08 23:22:19 changed by dwhittle

  • status changed from new to closed.
  • resolution set to wontfix.

The issue is not in the plugin, but in the way sfMailView handles the lookup for alternate body. Unfortunately, this is a wontfix (as I will not change the core to make the plugin work).. This is fixed in 1.1 (as you should use swift mailer and fetch the template with renderPartial|Component or ->getPresentationFor(). My apologies for taking so long to investigate.