Announcement

Collapse
No announcement yet.

Create email when new version is available?

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

  • Create email when new version is available?

    Is there a way to generate an email to myself when Espocrm releases a new version so I'll know to update? I don't log in very often to check "Administration" where a notice is posted so an email would be better. Can it be done?

  • #2
    It outside of EspoCRM but I think you can subscribe to their Github and get email notification that way for new release.

    At least I'm sure Github should have that capability otherwise it is a bit disappointing.

    Comment


    • #3
      Thanks for the Github idea. I'll have to check it out.

      Here is sort of the workflow I was thinking about, although I don't know if this CAN be done or if I have the scripting skills to do it.

      - Go to the EspoCRM download page and get the current version: Latest Release EspoCRM 6.1.7 (May 05, 2021) and put 6.1.7 in a .txt file on your server where EspoCRM resides.

      From then on set up a cron job to do the following:

      - Do a curl and get the EspoCRM download screen and extract this line: Latest Release EspoCRM 6.1.7 (May 05, 2021)

      - . Parse the line to just get the version number (6.1.7)

      3 Read the saved .txt file and compare it to what was just obtained from the parse.

      4. If different:
      Create an email (using curl or ssmtp)... saying a new version is available.
      Put the new version into the text file, erasing the old one and save it.

      Instead of using curl to get the page you might be able to obtain it via the "php command version" but I'm not sure how to do that in a bash script... might be easier to do it in a PHP script?

      Anyway, if I can find some code the does parsing, I might give this a try. I don't want to sit down and figure out how to parse when I know there are tools that do this... maybe sed or awk?

      Anyone have any ideas?

      Comment


      • #4
        Is this it?

        Choose the type of activity on GitHub that you want to receive notifications for and how you want these updates delivered.

        Comment


        • #5
          I had some time so I thought I'd write a bash script to send me an email when a new version was available. The code is below. Of course, it will NOT work if EspoCRM changes the download page with the string that we search on.

          I run this via a crontab entry each night and if there was a change there will be an email waiting for me in the morning.

          Yes, this could have been done in less code by a better bash coder, but it works and the second or so I might save is not worth the effort.

          Code:
          #!/bin/bash
          
          # change directory
          cd /xxxx/xxxx/chk-espo-version
          
          # get the Espo download page, take out all the html and find the line we want. Put it in a .txt file
          curl -s https://www.espocrm.com/download/ | html2text | grep 'Latest Release EspoCRM' > from_espocrm.txt
          
          # set up two variables we will use in the 'if' statement
          var_from_espocrm=$( cat from_espocrm.txt )
          var_prev_version=$( cat prev_version.txt )
          
          # print out for testing
          #echo "var_from_espocrm " "$var_from_espocrm"
          #echo "var_prev_version " "$var_prev_version"
          
          # check to see what was in the previous version file with this one
          
          if [ "$var_from_espocrm" != "$var_prev_version" ]
          then
          
          # empty out the email.txt file
          > email.txt
          
          # set up our email.txt file for sending
          echo "From: your title <xxx@yyy.com>" >> email.txt
          echo "To: your-name <xxx@yyy.com>" >> email.txt
          echo "Subject: New EspoCRM version" >> email.txt
          echo "---------- " >> email.txt
          date >> email.txt
          echo "---------- " >> email.txt
          echo "Message: " "$var_from_espocrm " >> email.txt
          
          # save the new version into a txt file (that we checked above.)
          echo "$var_from_espocrm" > prev_version.txt
          
          # send the email via curl
          curl -s smtp://xxxx.mail.xxxx.com --mail-from xxx@xxxx.com --mail-rcpt xxx@yyyy.com --upload-file email.txt
          
          
          fi
          
          # touch a file showing the time we are done.
          touch chk-espo-verion-time.txt
          I hope this might help someone.

          Alan N. Canton, Managing Partner
          NewMedia Create

          Fair Oaks, CA

          Comment


          • esforim
            esforim commented
            Editing a comment
            It look very good (and I assume it working as intended). But curiosity why you went the complex route and not just use the build-in notification feature of Github?

        • #6
            • notification feature of Github?
          I looked and looked and could not figure out how to set up a notification with GitHub. Besides, I rather enjoyed the challenge of figuring this out for myself.

          Comment


          • #7
            My bad, I should have link it with the #anchor.

            It under this section: https://docs.github.com/en/github/ma...ual-repository

            Seem quite straight forward from the look of it:
            (1) click watch
            (2) custom
            (3) choose release

            Comment


            • #8
              Thanks for this. Had I know it was this easy I guess I would have done it... and I still will. But I will keep my system in place since I know it works... unless/until Espocrm changes the page format!!!

              Comment

              Working...
              X