Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

email templates and reminders

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    email templates and reminders

    I was able to easily setup office 365 email send email. How do I setup reminders and email templates that dynamically sends emails to configured users and replaces template with actual data?

    Hi,

    your proposal {proposalnamefromdb} is approved.

    Proposaldate {proposaldatefromdb}

    Do not reply.

    something like this

    I created a5w page and on render I am able to send email and I think I can scheduele this page to run using some curl but not sure how to close, can I self close the page after send email via script?
    Last edited by amitloh; 02-28-2018, 01:56 PM.

    #2
    Re: email templates and reminders

    Hey Amit

    if you run it via curl the page should execute not open, so what is there to close.

    You can create a scheduled task within your windows machine (suggest using you windows Production server - on 24/7) and run a curl command which will execute your published a5w page siting on a production server
    Alex Collier

    "The spread of computers and the Internet will put jobs in two categories. People who tell computers what to do, and people who are told by computers what to do"

    AA Builds from 5221_5152 to Pre-releases >> Deploying to IIS in AWS

    Comment


      #3
      Re: email templates and reminders

      ok great thanks Alex. Now I need to know how to use email template and replacement in alpha. I have done this in dotnet before.

      Comment


        #4
        Re: email templates and reminders

        Hey Amit.

        You can use The Alpha Anywhere templating library in Xbasic code through the a5_merge_JSON_into_template() Function.

        Use your a5w page to execute Xbasic to run a SQL Query.

        After that you can then convert convert the result set into json using the rs.tojson() function

        from here you define your template and pass in the json data.

        Then you would need to write the code to handle the emailing

        Here code for a Email Handler Module

        function emailModule as p (emailTo as c, emailSubject as c, emailBody as c, emailFilename as c, requireReponse as l)

        'To use this function
        'DIM [anyname] as p

        '[anyname] = require("Email_Handler")

        'Example of One Function in this file
        '[anyname].emailme(emailTo as c, emailSubject as c, emailBody as c, emailFilename as c, requireReponse as l)

        dim psmtpSettings as p
        'The following properties must be set in pSMTPSettings:
        psmtpSettings.smtp_server = "smtp.gmail.com" ' - the address of the smtp server. e.g.'smtp.gmail.com'
        psmtpSettings.smtp_username = "@gmail.com" 'your email account user name - e.g. 'fred' or '[email protected]'
        psmtpSettings.smtp_password = "" '- your email account password - e.g. 'mysecretpassword'
        psmtpSettings.smtp_port = "465" '- the port e.g. 465. This depends on the server. For example with Gmail, the port is often 587

        dim pmessage as p
        'The following properties can be set in pMessageSettings:
        '(You can omit certain of the properties, if not needed)

        'pmessage.message = emailBody 'the plain text version of the message ' Not used as HTML used as the default

        'Below is the html version of the message which is the default used
        pmessage.html_message = emailBody
        pmessage.send_to = emailTo 'a comma delimited list of email addresses
        pmessage.subject = emailSubject 'the message subject - in plain text
        pmessage.attachments = emailFilename 'a comma delimited list of file attachements
        'pmessage.cc = "" '- a comma delimited list of email addresses
        'pmessage.bcc = "" '- a comma delimited list of email addresses
        pmessage.lRelated = .f. '- .t., or .f.
        pmessage.ReturnReceipt = .f. '.t., or .f.
        pmessage.from = "@gmail.com" '- the email address of the sender
        pmessage.from_alias = " No Reply" '- friendly name of the sender

        Dim sendemailA as p
        sendemailA = email_send_noprofile(pSmtpSettings ,pmessage ,"SSL") 'P Result = email_send_noprofile(P pSmtpSettings ,P pMessageSettings ,C secureMode [,L autoWrap [,L flagUseDotNetLibrary ]])

        dim Emailresult as c
        if sendemailACBA.error = .f. then
        Emailresult = "Email was sent successfully"
        else
        Emailresult = "Email was un-successfully and returned the following errors " + sendemailA.errorText
        end if

        dim returning as p
        returning.sendemailA = sendemailA
        returning.Emailresult = Emailresult

        if requireReponse = .t. then
        emailModule = returning
        end if


        end function

        exports.emailme = emailModule

        Look into the following references in relation to templates

        https://www.alphasoftware.com/docume...template().xml

        https://www.alphasoftware.com/docume...e%20Method.xml
        Alex Collier

        "The spread of computers and the Internet will put jobs in two categories. People who tell computers what to do, and people who are told by computers what to do"

        AA Builds from 5221_5152 to Pre-releases >> Deploying to IIS in AWS

        Comment


          #5
          Re: email templates and reminders

          great! thank you again. I will also try
          https://www.alphasoftware.com/blog/c...alpha-anywhere

          https://www.alphasoftware.com/docume...20Template.xml
          Last edited by amitloh; 03-01-2018, 09:29 AM.

          Comment


            #6
            Re: email templates and reminders

            I was able to setup viewbox with dynamic template.

            Now how do I get entire viewbox data in js.
            below gives me object object.

            var vb = {dialog.object}.getControl('viewbox2');
            var itemsid = vb.data;
            alert('Item ID = ' + itemsid);

            Comment


              #7
              Re: email templates and reminders

              Comment


                #8
                Re: email templates and reminders

                I want to extract html built in viewbox using json/sql and send an email. Its almost codeless then!
                Last edited by amitloh; 03-01-2018, 10:07 AM.

                Comment


                  #9
                  Re: email templates and reminders

                  Originally posted by amitloh View Post
                  I was able to setup viewbox with dynamic template.

                  Now how do I get entire viewbox data in js.
                  below gives me object object.

                  var vb = {dialog.object}.getControl('viewbox2');
                  var itemsid = vb.data;
                  alert('Item ID = ' + itemsid);
                  You are close :). The reason for recieving object object is because its a object. use the following instead

                  JSON.stringify(vb.data) < this would be the data of the Viewbox.
                  from here you could just run action javascript to send email.
                  Alex Collier

                  "The spread of computers and the Internet will put jobs in two categories. People who tell computers what to do, and people who are told by computers what to do"

                  AA Builds from 5221_5152 to Pre-releases >> Deploying to IIS in AWS

                  Comment


                    #10
                    Re: email templates and reminders

                    Originally posted by amitloh View Post
                    I want to extract html built in viewbox using json/sql and send an email. Its almost codeless then!
                    For the HTML you will need to wrap the whole HTML in a div with an id in the viewbox properties "Post process Javascript"

                    html = '<div id="ViewboxID">' + html + '</div>';
                    return html

                    Then you can reference the whole HTML within the div (Which is the rendered HTML of the Viewbox by calling the folliowing javascript code

                    var ele = jQuery('#ViewboxID')
                    var htmltoemail = ele[0].innerHTML
                    Alex Collier

                    "The spread of computers and the Internet will put jobs in two categories. People who tell computers what to do, and people who are told by computers what to do"

                    AA Builds from 5221_5152 to Pre-releases >> Deploying to IIS in AWS

                    Comment


                      #11
                      Re: email templates and reminders

                      thanks!

                      I was able to extract entire html from viewbox by getelementbyid and innerhtml but when I send an email I get this in an email(I tried both html and text option in js sendemail options.

                      <div id="DLG1.V.R1.VIEWBOX1.CONTROL.CONTENTOLD" style="position:
                      absolute; width: 100%; display: none;"></div><div id="DLG1.V.R1.VIEWBOX1.CONTROL.CONTENT"><div class="GrOliveListItem"
                      a5-item="_AARow" a5-value="John Smith" id="A5UID1"> <div style="display:
                      table; width: 100%;"> <div style="display: table-cell;"> <div
                      class="" style="float: right;">MA</div> <div
                      class="">Smith</div> <div class="">John</div> <div
                      class=""> Boston<br> </div> </div> <div style="display:
                      table-cell; width: 40px; text-align: right; vertical-align:
                      middle;"> <img src="a5file://C:/Program Files
                      (x86)/a5V12/css/GrOlive/ListNav.png"> </div> </div></div><div
                      class="GrOliveListItem" a5-item="_AARow" a5-value="Henry Rhodes"
                      id="A5UID2"> <div style="display: table; width: 100%;"> <div
                      style="display: table-cell;"> <div class="" style="float:
                      right;">NY</div> <div class="">Rhodes</div> <div
                      class="">Henry</div> <div class=""> New
                      York<br> </div> </div> <div style="display: table-cell;
                      width: 40px; text-align: right; vertical-align: middle;"> <img
                      src="a5file://C:/Program Files
                      (x86)/a5V12/css/GrOlive/ListNav.png"> </div> </div></div><div
                      class="GrOliveListItem" a5-item="_AARow" a5-value="Allison Berman"
                      id="A5UID3"> <div style="display: table; width: 100%;"> <div
                      style="display: table-cell;"> <div class="" style="float:
                      right;">CA</div> <div class="">Berman</div> <div
                      class="">Allison</div> <div class=""> Los
                      Angeles<br> </div> </div> <div style="display: table-cell;
                      width: 40px; text-align: right; vertical-align: middle;"> <img
                      src="a5file://C:/Program Files
                      (x86)/a5V12/css/GrOlive/ListNav.png"> </div> </div></div><div
                      class="GrOliveListItem" a5-item="_AARow" a5-value="Amanda Higgins"
                      id="A5UID4"> <div style="display: table; width: 100%;"> <div
                      style="display: table-cell;"> <div class="" style="float:
                      right;">IL</div> <div class="">Higgins</div> <div
                      class="">Amanda</div> <div
                      class=""> Chicago<br> </div> </div> <div
                      style="display: table-cell; width: 40px; text-align: right;
                      vertical-align: middle;"> <img src="a5file://C:/Program Files
                      (x86)/a5V12/css/GrOlive/ListNav.png"> </div> </div></div><div
                      class="GrOliveListItem" a5-item="_AARow" a5-value="Nancy Clark"
                      id="A5UID5"> <div style="display: table; width: 100%;"> <div
                      style="display: table-cell;"> <div class="" style="float:
                      right;">MA</div> <div class="">Clark</div> <div
                      class="">Nancy</div> <div
                      class=""> Boston<br> </div> </div> <div style="display:
                      table-cell; width: 40px; text-align: right; vertical-align:
                      middle;"> <img src="a5file://C:/Program Files
                      (x86)/a5V12/css/GrOlive/ListNav.png"> </div> </div></div><div
                      class="GrOliveListItem" a5-item="_AARow" a5-value="Cecelia Dawkins"
                      id="A5UID6"> <div style="display: table; width: 100%;"> <div
                      style="display: table-cell;"> <div class="" style="float:
                      right;">CO</div> <div class="">Dawkins</div> <div
                      class="">Cecelia</div> <div
                      class=""> Boulder<br> </div> </div> <div
                      style="display: table-cell; width: 40px; text-align: right;
                      vertical-align: middle;"> <img src="a5file://C:/Program Files
                      (x86)/a5V12/css/GrOlive/ListNav.png"> </div> </div></div><div
                      class="GrOliveListItem" a5-item="_AARow" a5-value="Kathy Morton"
                      id="A5UID7"> <div style="display: table; width: 100%;"> <div
                      style="display: table-cell;"> <div class="" style="float:
                      right;">NY</div> <div class="">Morton</div> <div
                      class="">Kathy</div> <div class=""> New
                      York<br> </div> </div> <div style="display: table-cell;
                      width: 40px; text-align: right; vertical-align: middle;"> <img
                      src="a5file://C:/Program Files
                      (x86)/a5V12/css/GrOlive/ListNav.png"> </div> </div></div></div>

                      Comment


                        #12
                        Re: email templates and reminders

                        I honestly think you should just take the data and define the html in the builder of the send email action javascript. There is a lot of rubbish html above, along with references to css which i am guessing you did not embedded in the html when sending the email.

                        If you really want to do it by taking the innerHTML try wrapping the whole thing in HTML Tags?
                        Alex Collier

                        "The spread of computers and the Internet will put jobs in two categories. People who tell computers what to do, and people who are told by computers what to do"

                        AA Builds from 5221_5152 to Pre-releases >> Deploying to IIS in AWS

                        Comment


                          #13
                          Re: email templates and reminders

                          I tried simple and it shows in email as
                          Fred <b>Boston</b> but screen shows proper.

                          email.png

                          Comment


                            #14
                            Re: email templates and reminders

                            email.png
                            almost close...

                            Comment


                              #15
                              Re: email templates and reminders

                              What code are you using to send the email you will need to post
                              Alex Collier

                              "The spread of computers and the Internet will put jobs in two categories. People who tell computers what to do, and people who are told by computers what to do"

                              AA Builds from 5221_5152 to Pre-releases >> Deploying to IIS in AWS

                              Comment

                              Working...
                              X