Skip to Content Skip to Menu

[SOLVED] Send PM to all online members when new member joins - Auto action

  • Buzz50
  • Buzz50
  • OFFLINE
  • Posts: 180
  • Thanks: 10
  • Karma: 2
10 years 2 months ago - 10 years 2 months ago #247698 by Buzz50
What is the best way to send a PM to all online members when a new member joins?

I only need an entry in the UddeIM database table.

Could somebody please possibly work out the query with substitution?

i.e. Hi Dave, Lucy has just joined our forum as a new member, click here to see her profile.

My URL for profiles is:
www.buzz50.com/my-profile/userprofile/Lucy

Buzz50
Mike
Buzz50 Seniors
'Head Buzzer'
Last edit: 10 years 2 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 2 months ago - 10 years 2 months ago #247779 by krileon
Using CB Auto Actions on the after registration trigger and the Query action you should be able to do this. The substitutions will be based off the user registering. Should be doable with an insert query with the values from a select query. Example as follows.

Code:
INSERT INTO `#__uddeim` ( `fromid`, `toid`, 'message' ) VALUES SELECT '[user_id]', `id`, '[name] has just joined our forum as a new member!' FROM `#__users` WHERE `id` != '[user_id]'

You won't be able to use substitutions for the sender and recipient unless you use PHP and loop through your entire user base and setup the substitutions.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 10 years 2 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • Buzz50
  • Buzz50
  • OFFLINE
  • Posts: 180
  • Thanks: 10
  • Karma: 2
10 years 2 months ago #247787 by Buzz50
Thank you Kyle.

Would I be able to send the message just to members who are logged in using the sessions table?

Buzz50
Mike
Buzz50 Seniors
'Head Buzzer'

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 2 months ago - 10 years 2 months ago #247840 by krileon
Yes, you could query the session table and pull user id from it. Example as follows.

Code:
INSERT INTO `#__uddeim` ( `fromid`, `toid`, `message` ) VALUES SELECT '[user_id]', `userid`, '[name] has just joined our forum as a new member!' FROM `#__session` WHERE `userid` != '[user_id]' AND `guest` = 0


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 10 years 2 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • Buzz50
  • Buzz50
  • OFFLINE
  • Posts: 180
  • Thanks: 10
  • Karma: 2
10 years 2 months ago #247878 by Buzz50
Hi Kyle and thank you.

That query is giving me the error below:

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''message' ) VALUES SELECT '19178', `userid`, 'Mike Barrett has just joined our f' at line 1 SQL=INSERT INTO `wxo_uddeim` ( `fromid`, `toid`, 'message' ) VALUES SELECT '19178', `userid`, 'Mike Barrett has just joined our forum as a new member!' FROM `wxo_session` WHERE `userid` != '19178' AND `guest` = 0

I apologise for asking again

Buzz50
Mike
Buzz50 Seniors
'Head Buzzer'

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 2 months ago - 10 years 2 months ago #247885 by krileon
Please try the below. I've tested it as working directly in phpmyadmin (with prefix replaced) so it should work ok for you.

Code:
INSERT INTO `#__uddeim` ( `fromid`, `toid`, `message` ) SELECT '[user_id]', `userid`, 'Mike Barrett has just joined our forum as a new member!' FROM `#__session` WHERE `userid` != '[user_id]' AND `guest` = 0


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 10 years 2 months ago by krileon.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum