Forums / Setup & design / Email Question

Email Question

Author Message

Arran Price

Sunday 13 March 2005 12:58:13 pm

Hi,
I would like to take the output of one my templates and send it as an email.
The email should be html formatted so images and formatting etc show up.
The email could be sent by clicking on a button or better yet would be set up automatically do it once per week at a set time.

Whats the best way of approaching this?

Im not really sure to start this so any help appreciated.

Arran

Paul Forsyth

Sunday 13 March 2005 2:24:07 pm

A couple of pointers.

First of all all emails sent from eZ derive from a template. So anything you put into the template will be emailed, which includes any html.

Im not 100% sure if the email headers need to specify whether mail is http or not. A quick google around the web can find that out.

When you need to process something a little more its better to drop down to php. If you create a simple module/view you should be able include your template and fire it off in an email.

A cronjob can handle the automation part.

Hope this helps a little.

paul

Arran Price

Sunday 13 March 2005 5:17:00 pm

thanks Paul.
Im still a little confused. I figure I will go the automation route. So can you (or anyone else) just confirm Im on the right track?

I have a template that gives me the correct output (Im currently using with an override for a node).
So next up I need to create a module which will do the emailing?
Then create a script that runs the module?
or Is the script enough to put in cron and reference/send the template output?

Are there any examples or documentation (I couldnt find any) on how to do this.
Ive got the documentation from the book which explains a bit, but Im still confused as to how the actual email gets created and how the template output is used in it.
The closest examples I found where the tip a friend and feedback templates but I couldnt determine what actually sends the email.

Ive done alot with templates but I havent created and modules and my php skills are fairly limited.

Arran

Paul Forsyth

Monday 14 March 2005 12:14:18 am

The module and cronjob/automation are entirely seperate. But both can use the same template that you can create.

Have a read of the docs on module creation:

http://ez.no/ez_publish/documentation/development/extensions/module/module_tutorial_part_1

I think other docs exists for this.

For the cronjob have a read of the docs starting at the following url:

http://ez.no/ez_publish/documentation/building_an_ez_publish_site/the_guestbook

paul

Arran Price

Monday 14 March 2005 11:56:49 am

thanks -
to clarify when you say "The module and cronjob/automation are entirely seperate. But both can use the same template that you can create."

Do you mean these are 2 different ways to achieve the same goal OR do I have to use both?

Im hoping I pick one method, although I dont see any reason to use a module. Ive read through the documentation you mentioned (previously and again). If I have the template already producing the desired output, I should just need to create an appropriate script correct?

thanks again

Arran

eZ debug

Timing: Jan 19 2025 04:25:28
Script start
Timing: Jan 19 2025 04:25:28
Module start 'content'
Timing: Jan 19 2025 04:25:30
Module end 'content'
Timing: Jan 19 2025 04:25:30
Script end

Main resources:

Total runtime1.8394 sec
Peak memory usage4,096.0000 KB
Database Queries200

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 588.8438180.8516
Module start 'content' 0.00541.5836 769.6953501.5234
Module end 'content' 1.58900.2504 1,271.2188338.1328
Script end 1.8394  1,609.3516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.2195210.0002
Check MTime0.00160.0873210.0001
Mysql Total
Database connection0.00060.031510.0006
Mysqli_queries1.761195.74042000.0088
Looping result0.00210.11361980.0000
Template Total1.812298.520.9061
Template load0.00180.096520.0009
Template processing1.810598.424920.9052
Template load and register function0.00030.018210.0003
states
state_id_array0.00090.047010.0009
state_identifier_array0.00260.142120.0013
Override
Cache load0.00150.0834450.0000
Sytem overhead
Fetch class attribute can translate value0.00180.096730.0006
Fetch class attribute name0.00180.097850.0004
XML
Image XML parsing0.00050.029730.0002
class_abstraction
Instantiating content class attribute0.00000.000950.0000
General
dbfile0.00160.0879210.0001
String conversion0.00000.000330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs