Jump to content


Swarm notifications via SMS or IM

swarm notification trigger

  • Please log in to reply
5 replies to this topic

#1 PeteS

PeteS

    Advanced Member

  • Members
  • PipPipPip
  • 62 posts

Posted 21 June 2015 - 04:59 AM

We have some Perl/curl tools to send messages through mediums such as IM, SMS Text, etc. and we'd like to use these tools to send Swarm notifications such as added as reviewer, review files added/update and/or review comment added through these channels, as well as through the existing Swarm emails.

What's the best way to do this in Perforce/Swarm? Unless I'm mistaken, these actions are not flagged by Perforce triggers, but rather through keys. Is there a good way to catch/trap/monitor these?

As an alternative, is there an easy way to send the same email message simultaneously through additional mechanisms?

Thanks,
Pete

#2 PeteS

PeteS

    Advanced Member

  • Members
  • PipPipPip
  • 62 posts

Posted 01 July 2015 - 12:46 PM

Should I infer from the lack of response that there are no triggers that I can use to detect actions like adding a comment to a review, adding a reviewer, adding files to a review, or changing the state of a review?

Thanks,
Pete

#3 P4Shimada

P4Shimada

    Advanced Member

  • Members
  • PipPipPip
  • 831 posts

Posted 01 July 2015 - 05:53 PM

Hi Pete,

I need to get confirmation from our Swarm developers to answer all your questions. However, in the Workshop there may be some existing Swarm projects that could help you accomplish what you want. For example, this Swarm module allows you to send Swarm events to a kato.im channel:

    https://swarm.worksh...-kato-for-swarm

REFERENCES

https://swarm.worksh...demo-extensions

#4 PeteS

PeteS

    Advanced Member

  • Members
  • PipPipPip
  • 62 posts

Posted 01 July 2015 - 09:06 PM

Ah, okay, I see. I didn't realize I needed to (or could) do this through events in modules - I (incorrectly) assumed I could / needed to use triggers.

I'll give these a go, thanks!

#5 PeteS

PeteS

    Advanced Member

  • Members
  • PipPipPip
  • 62 posts

Posted 10 July 2015 - 03:19 PM

Update: the Kato example was great, I now have a functioning prototype!

Four important things I learned:
  • The namespace at the top of the PHP file MUST be the same as the folder of the Module.php you've written
  • error_log (debug message) is indispensable for figuring out where things are going wrong
  • error messages are written to /var/log/apache2/swarm.error_log (I keep a window running with tail -f while testing)
  • And most important: when you update the PHP file you MUST restart the server (apachectl restart) *AND* refresh the swarm page that you are testing
Thanks for your help,
Pete

#6 P4Shimada

P4Shimada

    Advanced Member

  • Members
  • PipPipPip
  • 831 posts

Posted 15 July 2015 - 11:58 PM

Glad you have something up and running! :-) You're welcome.



Also tagged with one or more of these keywords: swarm, notification, trigger

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users