Forums / Setup & design / Sending different emails after creating object

Sending different emails after creating object

Author Message

Paul Etienney

Wednesday 13 August 2008 2:48:23 am

Hi,

I am wondering how to send three different mails to three persons after creating one object.
This object is a client (he has no user account) and I would like to tell him : "Ok we are taking care of you M. Smtih". I also want to send another email to a partner "We have a new client : M. Smith, please take care of him, his number is 888 777 666".

I few ideas about the how-to but i am sure it is quite easy.

Do you have any idea ?

Thank you very much.

-- Good websites creation --
My site : http://www.pauletienney.com
Twitter : http://www.twitter.com/p_etienney

Paul Etienney

Thursday 21 August 2008 2:43:48 am

Hi,

I am not sure I was really clear in my precedent message.

Here is exactly the process I want to build :

1 : A user create a new object. This object is a new client. One of the attribute of this client is his email adress.

2 : An email is sent to the client. This emails says something like : "Hello Mr. Smith we are taking care of you".

3 : An email is sent to the administrator. It says something like : "Hello Mr. Admin, a new client has been created. His name is Smith"

I guess the notification options is not what I want.
Do you have an idea ?

Thank you very much

-- Good websites creation --
My site : http://www.pauletienney.com
Twitter : http://www.twitter.com/p_etienney

Mark Marsiglio

Thursday 21 August 2008 4:36:18 am

The default behavior of the /user/register module sounds just like what you need.

1) A new visitor goes to /user/register and completes the form, which creates a new user object.
2) The new user receives a confirmation email to verify the email address, and clicks on the link
3) Another email is sent to the user with their username, password, and link to their profile
4) The AdminEmail (in site.ini) receives an email about the fact that a new users was created, and a link to their profile. Admins could click on the profile to see the phone number, or you could modify the email template to include that (you would also need to have a new phone number attribute in your Client class)

This should be the case with only a few modifications from a default ezwebin installation in settings, as long as your Client class has a user account. The settings that need to be changed are related to default user class and default user group ID.

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Paul Etienney

Thursday 21 August 2008 4:57:40 am

Thank you Mark.

The problem is that the new object is a client but do not have a user account. He will never visit the extranet.
Actually I need to send 3 different emails.

-- Good websites creation --
My site : http://www.pauletienney.com
Twitter : http://www.twitter.com/p_etienney

André R.

Thursday 21 August 2008 5:34:03 am

One option would be eZContentObjectEditHandler:
http://serwatka.net/blog/ez_publish_3_8_new_custom_edit_handler

Note that the structure of the functions have changed a bit in 4.0:

    function fetchInput( $http, &$module, &$class, $object, &$version, $contentObjectAttributes, $editVersion, $editLanguage, $fromLanguage  )
    {
    }
 
    static function storeActionList()
    {
        return array();
    }
 
    function publish( $contentObjectID, $contentObjectVersion )
    {
        return true;
    }

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

eZ debug

Timing: Jan 18 2025 10:58:56
Script start
Timing: Jan 18 2025 10:58:56
Module start 'content'
Timing: Jan 18 2025 10:58:56
Module end 'content'
Timing: Jan 18 2025 10:58:56
Script end

Main resources:

Total runtime0.1471 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 587.8594180.8125
Module start 'content' 0.00670.0047 768.6719102.0547
Module end 'content' 0.01140.1356 870.7266530.3750
Script end 0.1470  1,401.1016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00332.2685200.0002
Check MTime0.00130.9129200.0001
Mysql Total
Database connection0.00140.971210.0014
Mysqli_queries0.106072.04821410.0008
Looping result0.00120.80531390.0000
Template Total0.135391.910.1353
Template load0.00090.590610.0009
Template processing0.134491.354810.1344
Override
Cache load0.00070.443810.0007
Sytem overhead
Fetch class attribute can translate value0.00070.477010.0007
XML
Image XML parsing0.00020.135110.0002
General
dbfile0.00392.6556200.0002
String conversion0.00000.003630.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs