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

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 16:27:06
Script start
Timing: Jan 18 2025 16:27:06
Module start 'layout'
Timing: Jan 18 2025 16:27:06
Module start 'content'
Timing: Jan 18 2025 16:27:07
Module end 'content'
Timing: Jan 18 2025 16:27:07
Script end

Main resources:

Total runtime1.3392 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 588.0469152.6406
Module start 'layout' 0.00730.0036 740.687539.4922
Module start 'content' 0.01091.3267 780.1797622.1797
Module end 'content' 1.33760.0015 1,402.359416.1250
Script end 1.3391  1,418.4844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2472160.0002
Check MTime0.00130.0964160.0001
Mysql Total
Database connection0.00200.152610.0020
Mysqli_queries1.271394.9307650.0196
Looping result0.00080.0610630.0000
Template Total1.303597.320.6517
Template load0.00210.153920.0010
Template processing1.301497.179220.6507
Template load and register function0.00020.012310.0002
states
state_id_array0.00080.057910.0008
state_identifier_array0.00150.109820.0007
Override
Cache load0.00180.1315400.0000
Sytem overhead
Fetch class attribute can translate value0.00100.078430.0003
Fetch class attribute name0.00130.096680.0002
XML
Image XML parsing0.00160.116930.0005
class_abstraction
Instantiating content class attribute0.00000.0014100.0000
General
dbfile0.00110.0793280.0000
String conversion0.00000.000840.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 27
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs