0

I am currently using pubnub chat in one of the my application. And now I want to add functionalities like on each and every chat message I want to send mail,same as upwork website is doing.

For the same I have contacted pubnub support but they are not providing any such feature, So I need to send mails from my end, mostly by calling ajax and send mail from php.

But the major issue here is as its chat feature may I need to send number of mails (mass mail) in very short time. So my server doesn't supports it.

So how to implement mass mailing.

Er.KT
  • 2,852
  • 1
  • 36
  • 70

2 Answers2

2

Check Out PubNub BLOCKS

PubNub BLOCKS is a set of customizable microservices that give developers a simple way to add code and deploy features for realtime apps. PubNub BLOCKS execute business logic directly on the data streaming through PubNub’s network without splitting it off to an intermediary server controlled by the customer. This revolutionary approach streamlines app development, reduces endpoint-to-endpoint latency, and allows apps to better leverage the enormous scalability of PubNub’s Data Stream Network.

Sending email (or a Tweet, SMS, etc) with every published message, or only messages with an attribute such as email=true, is something that will be implemented as a BLOCK that you will be able to use out-of-the-box. Custom BLOCKS can be implemented to do whatever else you need to do for every message or certain messages without your server(s) getting invovled.

Community
  • 1
  • 1
Craig Conover
  • 4,710
  • 34
  • 59
1

With cakePHP I would suggest saving the E-Mails to be sent in a queue with a short Ajax call. This can be done with a json view. Then you can create a cron that calls the CakePHP Shell to send the mails with the standard CakePHP Mailer. If the Mails are time-critical or you don't have access to the server (cron) you can also send the mails directly on the ajax call. The advantage of the cron is that the call (from the browser) is short and that the mails (depending on the server) might need more time to be sent.

Here is an answer that might help you implementing it.

Community
  • 1
  • 1
DIDoS
  • 812
  • 9
  • 23