Path

ez projects / cjw_newsletter / forum / general / found a awkward problem


Found a awkward problem

You need to be logged in to post messages in the forums. New users may register here.

Ivo Luka─Ź

Member since:
06 May 2005

Posts: 36

Friday 04 June 2010 5:46:20 pm

I was trying to use the link to online version like this:



$archive_url = concat('/newsletter/archive/' , $edition_send_current.hash)




But it would not work. It only worked on preview when in 'process' status and in email which was sent the $edition_send_current was empty.

After some debugging I found out that when function CjwNewsletterEditionSend::create() is called (Send Newsletter action) for creating a row in 'cjwnl_edition_send', it uses CjwNewsletterEdition::createOutputXml() for generating email. So using $edition_send_current is not possible in that moment because the row is not yet stored in the database.

Solution would be to rewrite the CjwNewsletterEdition::createNewsletterSendObject() like this:



       $sendObject = CjwNewsletterEditionSend::create( $this );


       $sendObject->store();


        

       $sendObject->setAttribute('output_xml',$this->createOutputXml());


       $sendObject->store();




Calling $editionObject->createOutputXml() in CjwNewsletterEditionSend::create() is then not needed.

Hope this helps :)
Up

Felix Woldt

Member since:
17 February 2006

Posts: 75

Wednesday 09 June 2010 7:23:45 am

Hi Ivo,

the archive view should work because you already use it in admin.
If a newsletter is send out the preview of the newsletter in edition view is replaced with the archive view.

Thank's for testing and getting feedback :-)

I will have a look to the code, too.

http://www.jac-systeme.de - Developers united in eZ Publish: http://www.cjw-network.com
sponsor of http://ezsummercamp.com/

CJW Blog: http://www.cjw-network.com/en/blog
cjwpublish1411 - eZ Publish MultiSiteSetup - https://github.com/cjw-network/cjwpublish1411

Up

Felix Woldt

Member since:
17 February 2006

Posts: 75

Tuesday 15 June 2010 8:52:49 am

An other possiblity would to use a placeholder for the archive hash. This would be replaced when the mail is send out.

In the preview of an newsletter we do not have this hash, too. So we have a broken link.
So the placeholder should be show you that something is happen after send out.

http://www.jac-systeme.de - Developers united in eZ Publish: http://www.cjw-network.com
sponsor of http://ezsummercamp.com/

CJW Blog: http://www.cjw-network.com/en/blog
cjwpublish1411 - eZ Publish MultiSiteSetup - https://github.com/cjw-network/cjwpublish1411

Up

You need to be logged in to post messages in the forums. New users may register here.