Simple way to send email?

Author Message

Michael Hall

Tuesday 05 February 2008 10:20:16 pm

Is there a simple function (eZ 3.9.3) I can use to send email from a template without having to create a class and modify ini files as described in the Information Collector documentation? Something like the PHP mail() function?

If not, is it only possible to specify one EmailReceiver in [InformationCollectionSettings] per site in 'settings/siteaccess/my_site/site.ini.append.php'? I need to send an email to one specific address that is not the default.

Łukasz Serwatka

Tuesday 05 February 2008 11:53:05 pm

Hi,

There is an contribution that provide such functionality.
http://ez.no/developer/contribs/template_plugins/template_mailer

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Michael Hall

Wednesday 06 February 2008 12:39:09 am

Great, that looks like what we need. I know I should (and no doubt will) learn the more complex method, but for this particular template we don't need to store any data and don't need to retrieve or view it later. I already have the logic we need embedded into the existing template (using ezhttp) and didn't want to have to rewrite everything from scratch. Maybe not the eZ way, but time is of the essence!

Michael Hall

Wednesday 06 February 2008 9:41:21 pm

Just confirming that this solution has worked for us. Thanks again.

Example code here: http://ez.no/developer/contribs/template_plugins/template_mailer#msg158431

Hope this saves someone some time. As always, use at own risk!

Łukasz Serwatka

Wednesday 06 February 2008 11:22:59 pm

Thanks for sharing, Michael! ;)

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:07:11
Script start
Timing: Jan 18 2025 19:07:11
Module start 'layout'
Timing: Jan 18 2025 19:07:11
Module start 'content'
Timing: Jan 18 2025 19:07:12
Module end 'content'
Timing: Jan 18 2025 19:07:12
Script end

Main resources:

Total runtime0.6536 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 589.0469152.6250
Module start 'layout' 0.00610.0031 741.671939.4453
Module start 'content' 0.00920.6428 781.1172556.5156
Module end 'content' 0.65200.0015 1,337.632812.1641
Script end 0.6536  1,349.7969 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.5572160.0002
Check MTime0.00170.2556160.0001
Mysql Total
Database connection0.00080.129710.0008
Mysqli_queries0.599491.7042630.0095
Looping result0.00070.1004610.0000
Template Total0.604992.520.3025
Template load0.00210.324620.0011
Template processing0.602892.221620.3014
Template load and register function0.00010.020510.0001
states
state_id_array0.00290.444310.0029
state_identifier_array0.00230.347420.0011
Override
Cache load0.00170.2646190.0001
Sytem overhead
Fetch class attribute can translate value0.00090.133420.0004
Fetch class attribute name0.00140.219360.0002
XML
Image XML parsing0.00060.091220.0003
class_abstraction
Instantiating content class attribute0.00000.002670.0000
General
dbfile0.00240.3668180.0001
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs