-
-
Notifications
You must be signed in to change notification settings - Fork 178
026 How to setup a store message method along side the email helper class
In a previous tutorial on the Email Helper, mention had been made of storing messages or emails once it has been send. 00:00:24 At this stage it is important to know that the Email Helper Class is added to the Helper folder of the components back end. It's usually called the component's name, 'Jobtracking' and 'Email', that's the Email Helper class. To use it in the Custom Script three brackets may be used, [[[component]]]email' and send. 00:00:59 That is how to construct script.
At the bottom of this class in the 'Send' method, 00:01:21 there is a snippet, thought insignificant as it may seem, it is very beneficial, as may be seen, the result of the email that was sent is placed in 'sendEmail' and this result is transferred to the method as well. 00:01:47 First it does a search in the Helper class (which is usually a component name, 'Helper', which is the Helper Class) whether this method exists in that class.
This method will not exist unless it is manually written in the component area. The area where this method should be written , is in the component(In the Component Builder Dashboard) in an area called Admin Helper.00:02:13<<<<<<<<<<<<<<<<<<<<
We open a component. We go to libraries and helpers. We scroll down. We see there is email helper. Then underneath it, helper admin class. And it's in this(php) area that you need to add that method. Now I realized I've chosen the wrong components. This component actually does not use that storage concept, 00:02:47 but there is another one that does. Let's open that one instead then. So again we are in helper admin class, we have a function called storemessage, and this is in the components, where you edit your component. Storemessage has a signature. Values that it is passing to the method. In the 00:03:19 email helper class, you will see that it also has a signature. Wherever it gives this '=null' with a value, that is the default value. If you do not add a value for this position, there is one, two, three, four, fifth, positions, then it will default it to 0, if we do not add this, it will default to null. From there all the way to the end all of those values have the 00:03:51 null value. In reality you only need to add the first four values. Those values are all used in this method(see video). If you want to understand exactly how these value should look, look inside of the method, read through the method, and you will see.
Making a long story short, 00:04:17 we end up here at this little script. Basically ask whether you created the method or not. If you didn't it simple skips it and returns the value of send mail. If it sees that you have created it, it'll pass these variables that correspond to the signature. And then inside of that method that is in your helper class, that is how this method, you need to do the necessary checks and balances, and discovering for example since you've got the email address. 00:04:52 You can search with the getVar in the user class. It must equal email, recipient equal email, and then returns to us the id. So 00:05:09 That is basically how the getVar works. Then when we have the user id, we can make sure it's the number and we set it to our message as user. We set it 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 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.
- Home
- Beta Testing
- Custom Code
- PHP Settings
- Demo Component
-
Tutorials
- Hello World JCB
- Intro JCB Guide
- JCB Installation Steps
- Planning Components
- Field Type Overview
- Basic Fields Creation
- Admin View Management
- Advanced Field Usage
- Admin Component Integration
- Component Setting Customization
- Scripting Components
- Component FTP Options
- Dynamic Get Method
- Site View DynamicGet
- Site View Templates
- Template Setup Guide
- Layout Configuration Steps
- Custom Admin Management
- Adding Site Views
- Custom Admin Integration
- MySQL Demo Tweaking
- Global JCB Settings
- Custom Time Field
- User Helper Integration
- Email Helper Usage
- Message Store Email
- List View Unescape
- Export Import Customization
- Overwrite Custom Fields
- List Field Filtering
- Automatic Code Import
- Manual Code Implementation
- Component Export Import
- Custom Admin Buttons
- Translation Management
- Site View Permissions
- Component SQL Updates
- Site Edit Configuration
- JCB Backup System
- Helper Structure Integration
- JCB v2.5 Upgrade
- Tab Setup Guide
- JCB v2.6 Release
- Extended HelloWorld
- Field Rule Validation
- Community Snippets Intro
- Snippet Forking Tutorial
- Pull Request Snippets
- Library Manager Area
- Excel-based Translation
- Dynamic Router Details
- Database Auto Updates
- Subform Quick Demo
- VDM Package Import
- Dynamic File Inclusion
- File Field Upload
- Drag-n-Drop Upload
- Quick HelloWorld JCB
- Non-database Fields
- Dashboard Customization
- Menu Prefix Toggle
- Community JCB Packages
- Collaborative JCB Workflow
- JCB Package Install
- JCB JAB18 Event
- Convenient New Fields
- Component Language Strings
- Library Functionality Anticipation
- Join Field Relations
- License Template Change
- Code Reusability
- Local Dev Environment
- Extended Field Types
- Joomla Custom Fields
- Custom Field Expansion
- Site View Listing
- Run Expansion Method
- Form Site View
- Field URL Update
- Additional Helper Methods
- Field Validation Rules
- New Placeholder Feature
- Component Config Params
- Per-field Default Values