Create notification for when a customers account details are updated - zuora

Is it possible to create a zuora notification for when the customers account details (email, first name, etc.) are updated? Our example usecase is like so:
If the customers email address is updated (either via an API REST request, within zuora, when re-purchasing a product); trigger a notification that sends an email to the customer (the email will say something along the lines of 'Your account details have updated. If this was you please ignore this email'.

Related

Duplicated/Triplicated contacts in Mautic-Pipedrive

I have my Mautic account that imports the Pipedrive persons. The major part of my contacts appear duplicated. The first is only created. The second one is created and updated. The two contacts are created at the same time.
Also, if I actualize a contact in Pipedrive, it only updates in one contact in Mautic (in the second one).
I tried with only the unique key of email, also with unique keys as Phone, email, IDPipedrive. All my contacts have email and Phone.
I also tried with Updatable contacts and still does not work!
Also sometimes there are contacts that are created 3 times, and some that are only one 1.
What can I do?
This should be fixed in Mautic 2.15.0. (beta version was released yesterday). The reason for duplication is when you configure both create and update webhooks for contacts. Pipedrive for some reason sends both webhooks at the same time when the contact is created in Pipedrive. This leads to a race condition and Mautic creates both. The documentation is updated to lead you to create only webhooks for updates.
https://www.mautic.org/docs/en/plugins/pipedrive.html
Select updated to send to Mautic updated events for the given object. Do not select * as Pipedrive will send the updated events on create event too. If you select * the contacts/companies/users will be duplicated.
Mautic 2.15.0 will ignore the create webhooks and so the badly configured webhooks won't cause duplications.

GCM and Mysql database design

Suppose I have an app that send notifications to users through GCM. Each user can choose out of several topics that it can be notified about.
I have a user table in which I store the GCM registration IDs of the users in addition to my own user_IDs, and I have a topic table where I store the available topics to choose from.
I also have a user_topics table where I store the user ID and the topic ID, so when a user choose a topic, it inserts a row to that table with the user ID and the ID of the chosen topic.
When I send the notifications, I query the user_topics table for all the user IDs that are assigned to the topic which I notify about and then query the user table to get the respective GCM registration IDs.
This can triple the duration of the notification sending process compared to a case where I would store the registration IDs not only in the user table but also in the user_topics table so I wouldn't have to query the user table when sending.
I know that a good practice is to store the registration IDs in the user table only, but in the notifications world the most important thing for me is to send the notification in the shortest time possible.
Will it be right to store the registration IDs in the user_topics table to shorten the sending process?

MySQL Database table

I really need some help. I have this project and confused how to build its database
I have this general messaging.
students have year and section
I need to send a message in different types
Send to all students
Send to all students who wants to receive daily update
Send to students who are belong in specified years
Send to students who are belong in that year who wants to receive daily update
Send to students who's belong to sections
Send to students who's belong to sections and who wants to receive daily update
Send to students who's year is and section is
Send to specific students
some features
Resend notification to new students
Time of notification to end sending
now here is my structure of database
message_queue
id
type
message
isWantToReceive
date_added
type field value is json string
i save it something like this
sample value
id type Message isWantToReceive date_added
1 a:1:{s:3:"all";a:0:{}} Hi welcome! 0 2009-12-2
2 a:1:{s:6:"others";a:5:{s:7:"year";a:1:{i:0;s:11:"1";}s:10:"section";a:1:{i:0;s:7:"1";}}} Hi welcome! 0 2009-12-2
then i have a cron job sender that will query it and send message depending on the type.
My problem is when querying all the notification that been send like
get all notification that been send to year 2 or year 1 section 1
since my type field is a json. Can you help me restructure my database design on how my features work.
Well, in addition to your message_queue table you should have a table as follows:
student
id
year
section
wantsDailyUpdates
This table will allow you to keep track of all the students and which year and section they're in. As well as whether or not they want to receive daily updates.

database design issue...for booking app

I have 4 tables,one is credentials(it holds an id, email and password), the other 2 are for business users and regular users of the app.
The business users table holds crID(foreign key)name,lastname,address etc...
The regular users table holds crID(foreign key),name,lastname etc...
The 4th is the booking table, it holds a bookingID, bookedfrom,bookedfor(the last 2 being foreign keys that point to the credentials table).
If a regular user registers in the site he closes a bookingslot and that is stored in the booking table, his name,last name are stored in the regular users table and his credentials in the credentials table.
The business user table just holds the business user for which a booking is made by the regular users.
Here is a graph:
db image
The question is what to do if a regular user does not choose the web to make the booking but makes a call. The business users are given the option to make the booking "manually" also. I am just having difficulty how to integrate that in the db.
As I see it I need to make the following:
Create a booking slot in the bookings table
Create a new regular user entry in the regular users table and at the same time create another column that would indicate if the user is registered or not.
create an entry in the credentials table but without password/email since this he will not be a registered user...he just made a booking using the phone.
WHat is your opinion.If you want I will post some show create statements. I think I made my point.
I would personally merge business users, normal users and optionally credentials in one single userstable.
Since I don't see the need of two seperate tables for your users, it would simplify drastically your data model. You just need a flag to determine if the user is a business user or a normal user.
For the rest, I think that having a null password is enough to determine if the user hasn't registered yet.

Bulk user delete with same email

I want to delete all users who have the email address of #trash-mail.com
How can I do that with a SQL? I'm trying this
DELETE from users
WHERE email LIKE %trash-mail.com
But it's not working and I really need to be able to delete mass accounts.
You forgot quotes:
DELETE FROM users
WHERE email LIKE '%trash-mail.com'
See http://www.techonthenet.com/sql/like.php for more information on the LIKE condition.