From 41476ecb7db3e9c9ac05c8740cc8a1420f9abce8 Mon Sep 17 00:00:00 2001 From: Amigo <49749100+aamigo@users.noreply.github.com> Date: Fri, 5 Jul 2019 09:21:52 +0200 Subject: [PATCH] Updated 026 How to setup a store message method along side the email helper class (markdown) --- ...tore-message-method-along-side-the-email-helper-class.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/026-How-to-setup-a-store-message-method-along-side-the-email-helper-class.md b/026-How-to-setup-a-store-message-method-along-side-the-email-helper-class.md index d34c24a..17ba445 100644 --- a/026-How-to-setup-a-store-message-method-along-side-the-email-helper-class.md +++ b/026-How-to-setup-a-store-message-method-along-side-the-email-helper-class.md @@ -13,8 +13,6 @@ At the bottom of this class in the 'Send' method, [00:01:21](https://www.youtube Open a component(Learning manager) and go to Libs & Helpers. Scroll down and 'Add PHP(admin_helper)' may be seen and in there is a function called 'storemessage', where the component may be editted. [00:02:47](https://www.youtube.com/watch?v=peVNLsAncGY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m47s) This 'Storemessage' has a signature that exists of values that is transferred to the method. -In the Email Helper Class it also has a signature. [00:03:19](https://www.youtube.com/watch?v=peVNLsAncGY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m19s) Wherever it gives this '=null' with a value, that is the default value. If a value is not added to this position, there is one, two, three, four, five, positions, then it will default it to '=null'. [00:03:51](https://www.youtube.com/watch?v=peVNLsAncGY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m51s) From there all the values receives the value '=null' . It is only nessesary to add the first four values. Those values are all used in this method(see video). [00:04:17](https://www.youtube.com/watch?v=peVNLsAncGY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m17s) This script "if(method_exists('Jobtracking Helper','storeMessage'))" asks whether the method has been created. If not, it simply skips it and returns the value of '$sendmail'. [00:04:52](https://www.youtube.com/watch?v=peVNLsAncGY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m52s) If it have been created, it will pass these variables that correspond to the signature. In that method that is in the Helper Class (PHP), the necessary checks and balances must be done, since the email address is known, a search may be done with the 'getVar' in the User Class. The recipient must equal 'email', and returns the 'id'. [00:05:09](https://www.youtube.com/watch?v=peVNLsAncGY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m09s) That is how the 'getVar' operates. Then having the user ID, the number can be verified and be set to the message as 'User'. That is then set as the Email.<<<<<<<<<<<<<<<<<<<<<<<< +In the Email Helper Class it also has a signature. [00:03:19](https://www.youtube.com/watch?v=peVNLsAncGY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m19s) Wherever it gives this '=null' with a value, that is the default value. If a value is not added to this position, there is one, two, three, four, five, positions, then it will default it to '=null'. [00:03:51](https://www.youtube.com/watch?v=peVNLsAncGY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m51s) From there all the values receives the value '=null' . It is only nessesary to add the first four values. Those values are all used in this method(see video). [00:04:17](https://www.youtube.com/watch?v=peVNLsAncGY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m17s) This script "if(method_exists('Jobtracking Helper','storeMessage'))" asks whether the method has been created. If not, it simply skips it and returns the value of '$sendmail'. [00:04:52](https://www.youtube.com/watch?v=peVNLsAncGY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m52s) If it have been created, it will pass these variables that correspond to the signature. In that method that is in the Helper Class (PHP), the necessary checks and balances must be done, since the email address is known, a search may be done with the 'getVar' in the User Class. The recipient must equal 'email', and returns the 'id'. [00:05:09](https://www.youtube.com/watch?v=peVNLsAncGY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m09s) That is how the 'getVar' operates. Then having the user ID, the number can be verified and be set to the message as 'User'. That is then set as the Email. - - - Now we can store the message in whatever table or do whatever we want to do beyond the normal. Even if you want to do other things except [00:05:38](https://www.youtube.com/watch?v=peVNLsAncGY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m38s) storing the message. This is the method inside of which you can do it. Storemessage is the method inside which you can do some more custom scripting on top of your email integration. That's just quickly giving a little bit more depth on that specific aspect of using the email class in your component. \ No newline at end of file +Now the message may be stored in any table and more exceptional tasks may be performed than only that of storing the message and this(See video) is the method in which it can be done. [00:05:38](https://www.youtube.com/watch?v=peVNLsAncGY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m38s) 'Storemessage' is the method with which more custom scripting on top of the email integration can be done. \ No newline at end of file