6 Replies Latest reply on Dec 29, 2009 12:29 PM by zzipper7

    Email workaround?

    zzipper7 Level 1

      SOAPBOX:

       

      I’m completely frustrated with the developments of ADDT and the lack interest by Adobe to help (why would they when they can sell us a new more expensive solution in a year) I love Adobe for some things but this is a real point of contention for me and my business.

       

      Gunter is a true hero and understands that we are all tied to the old system and will lose much while moving over to newer systems. He has saved me more times than I can count. My team and I are moving to http://codeigniter.com/ , I’m sure it will have its own set of issues, but at least I’ve chosen a direction.

       

      ISSUE

      Ok, down from my soapbox, I have real issues to be solved. I have many sites that the email is still failing, clients are angry and I don’t wish to rebuild sites for free. I read the 5.2.10 thread that had 3900+ views (hint hint Adobe) and I just don’t have time to fix ADDT.

       

      I want a simple work around. I have plenty of “mailto” scripts I trust for the moment. 

       

      HOW CAN I TIE A FUNCTION TO THE END OF A REGISTRATION TRIGGER? If I could insert a simple function at the end of the registration insert  where the email trigger would normally go, I could move on with my life.

       

      I would need the last record inserted or the current function email var to send the email. I think this is a simple work around for broken sites.

       

      Anyone?

        • 1. Re: Email workaround?
          Günter Schenk Level 4

          Hi,

           

          zzipper7 wrote:

           

          HOW CAN I TIE A FUNCTION TO THE END OF A REGISTRATION TRIGGER? If I could insert a simple function at the end of the registration insert  where the email trigger would normally go, I could move on with my life.

          I would try with defining your stuff within a Custom Trigger (type AFTER or END), because this one *is* actually a standard PHP function

           

          Cheers,

          Günter

          • 2. Re: Email workaround?
            zzipper7 Level 1

            I was unable to do this with the help files, would you be willing to provide an example function  (of any kind) and I should be able to work it out.

             

            Thanks,

            James

            • 3. Re: Email workaround?
              Günter Schenk Level 4

              Hi James,

               

              would you be willing to provide an example function  (of any kind) and I should be able to work it out.

              My creating a directory after inserting a record - tutorial is based on a pretty basic example which nonetheless may be a good starting point.

               

              Cheers,

              Günter

              • 4. Re: Email workaround?
                zzipper7 Level 1

                Ok ,that was somewhat helpful, thank you. If a can trouble you once more please.

                 

                The old email function was:   $userRegistration->registerTrigger("AFTER", "Trigger_WelcomeEmail", 40);

                 

                What I want to do:   $userRegistration->registerTrigger("AFTER", "MY_NEW_FUNCTION", 40);

                 

                1. Is this syntax above correct?

                 

                2. Where must the function be placed? Top of same page?

                 

                3. Where will my variables come from for the new function ( I need to send the user their name and password) shouldn't the data be available in the previous insert function or should I take them from post data?

                 

                Would my regular function trigger properly based on the syntax above and below here?

                 

                function   MY_NEW_FUNCTION () {             // or does the function need a prefix "Trigger_ MY_NEW_FUNCTION"

                 

                     $content = "{$email} & " ;  // use post data or vars from previous trigger??

                 

                     DO EMAIL STUFF HERE;

                }

                 

                 

                I appreciate your time, I think this post will help others too. I hope.

                 

                 

                 

                 

                Thanks,

                James

                • 5. Re: Email workaround?
                  Günter Schenk Level 4

                  zzipper7 wrote:

                   

                  The old email function was:   $userRegistration->registerTrigger("AFTER", "Trigger_WelcomeEmail", 40);

                   

                  What I want to do:   $userRegistration->registerTrigger("AFTER", "MY_NEW_FUNCTION", 40);

                   

                  1. Is this syntax above correct?

                  The syntax is indeed correct, however just in case you want to keep the existing Trigger_WelcomeEmail - Trigger, you d have assign a different "priority" value (better said: execution order) to your Custom Trigger, because you can´t have e.g. "40" for two triggers of the same type (AFTER/BEFORE).

                   

                  2. Where must the function be placed? Top of same page?

                  the cool thing about PHP functions is, that they can be placed anywhere within the page.

                   

                  3. Where will my variables come from for the new function ( I need to send the user their name and password) shouldn't the data be available in the previous insert function or should I take them from post data?

                  Option 1: try with grabbing the main Insert Transaction´s transaction value like this: $tNG->getColumnValue("column_name")

                  Option 2, if 1) doesn´t work: try with grabbing the $_POST['fieldname'] data

                   

                  // or does the function need a prefix "Trigger_ MY_NEW_FUNCTION"

                  nope :-)

                   

                  Cheers,

                  Günter

                  • 6. Re: Email workaround?
                    zzipper7 Level 1

                    Thank you, so much once again. I still say that there needs to be a Gunter Donation Fund account somewhere!

                     

                    Your clarifications helped, I thought the triggers were set to search a certain class in the includes, I wasn't aware I could use one to call a same page function. That really opens a ton of options.

                     

                    Any feedback on codeigniter before I get to deep into it?

                     

                    Thanks,

                    James Morris

                    Hotmail