Is there an email service that queries your own database for users? - email

Is there an email service that allows you to nicely query your own database to create the recipients list? The issue is that we do tons of specialized user segmentation to create lists of recipients. Trying to keep our database in sync with the email-service's database is risky and fraught with potential issues since user data will be updated frequently in multiple ways. But we still need the powerful features of a service like SendGrid or Mailchimp where such as A/B testing, open & click-rate reporting, WYSIWYG template design, etc.
My pipe dream is to have a service like Sendgrid or Mailchimp, but when it asks you who to send the email to, you specify parameters that you've created yourself. It sends these parameters to your server, and your server (using a little code that you've custom-written), performs a query on your user database and sends the recipient list back.
Does such a service exist?

You can do this with SendGrid, by specifying an external URL as your recipients input method.
When specifying the external URL you may select "Activate Dynamic Mode". Dynamic mode checks the URL when a Marketing Email is scheduled/sent, and updates the list accordingly.
Knowing this, you could specify an external URL whose parameters control a database query. This database query would eventually resolve to a CSV which SendGrid would process at send time. Thus removing the need to keep two databases in sync.
N.B. Dynamic mode has been known to have some problems if you specify additional columns in your csv (beyond name,email). This is slated to be fixed, however, as of this answer it has not been. If you create the list at send time, this problem will not occur.

Related

What is right way to create multi purpose rest end point?

I want to create a rest end point but I am not sure what is right way. For example I want to expose endpoint to create account but there are multiple account type like:
Normal account with property name, description, and current balance
Credit Card account with property name, description, current balance, grace period, billing date and current outstanding. Now the confusion is, Shall I create two endpoint for each of account type? or Shall I create single end point with all the property.
Shall I create two endpoint for each of account type? or Shall I create single end point with all the property.
How would you do it on a web site?
You might have a single create-account form; you collect the information that you need from the visitor, the form is submitted to the server, and the server looks at the form details to determine what kind of account to create. Create the account, and send back a response to the browser announcing where the web page describing the account is. And that's fine.
You might do the same thing with multiple forms; through a series of links you guide the visitor to the form that best fits their circumstances, and then the remaining work is the same as above - the form is submitted, the server looks at the form details to determine the account to create, the account is created, the server sends back a response to the browser announcing where the web page describing the account is. And that's also fine.
You could do the same thing with multiple forms, but have each of the forms submit using a different target URI; you could even have each form submitted to a different host! Again, the actions taken by the host receiving the form are the same - do the work, return the result announcing where the new web page is.
Thw browser doesn't care, it's just collecting form inputs using standardized form processing rules, and then submit the result using the meta data in the form.
You'll want different code responsible for creating each of the different kinds of accounts (the "separation of concerns" idea), but it doesn't much matter if the routing of the request to that code is done purely mechanically (because you are using different URI) or "by hand".

REST api to allow multiple users edit the same form at the same time

I'm looking to make something similar to google docs where everyone can update the form (with multiple input fields) at the same time using REST api, the form data will be stored in database, is it possible?
I can have the form to send an update request whenever user make a change, but I still can't quite figure out what the logic to retrieve data/update form field content and resolve conflict when users are editing the same field.
Best way to use SignalR for realtime communication as well as pushing the updates to other users belonging to the similar group (may be call it as users of a same form). SignalR will provide all the underline infrastructure in place.

Is it possible to manipulate the database through mail in oracle apex?

I was having the similar problem as mentioned in the below link, Select and Display the table in oracle APEX mail body. I followed the mentioned steps and it worked!! .
Now, I just want to extend the same question and wanted to know, Is it possible to manipulate the the database through click on the button in the mail?
If I crate the html Button APPROVE, It should be able to manipulate database table.
Suppose, APPROVE performs delete operation: delete ename from emp where dno=10.
VERSION : ORACLE APEX 4.2
If you are sending an HTML email to a user and you want that user to interact with the system from the email, you could generate an HTML form that submits to a particular URL (some APEX page with some set of parameters) that actually implements the DELETE.
Assuming that the client email application would allow the user to submit a form, which would generally be a security issue and would probably not be possible from some clients, you'd probably have security issues to worry about on the server side. I'd assume, for example, that you don't want to allow any random person that works out the URL to call to be able to delete whatever row you want from your system. You probably want to require that someone is logged in before you'd allow them to delete a row. And you probably want to make sure that they have permission to delete that particular row.
It's certainly possible that you could work around both the client and the server side permission issues by doing something like creating a unique token that expires after a short period of time and gets passed in with the form to verify that the user has permission to delete that particular row. But by the time you're building that sort of infrastructure or sending users to a login page, you're probably better off just creating links in your email that point to a page in your application and letting users go there to request the actual delete. That's going to work more reliably than a form that submits a request and it will probably involve less work for you.

Reusable and robust pattern for handling "send email" steps via Processes

Background
Workflows and dialog processes in CRM 2011 (and CRM Online) allow us to send emails to email-enabled records (such as contacts, accounts and users). In the event that the email-enabled record does not have an email address, the process will fail with an exception (workflows remain in waiting state, dialogs throw the exception):
Unhandled Exception:
System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault,
Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35]]: Object address not found on party
or party is marked as non-emailable
My scenario
In many scenarios, faulting the entire process because an email couldn't be sent is heavy-handed (equally I accept that there are many scenarios where this behaviour is desireable too). As an example, if I am creating and updating many records as part of a large workflow and simply wish to send a simple, courtesy confirmation email at the end of the process, I do not want the entire process to fail simply because this final step could not complete. I can add a simple conditional statement to my workflow to check presence of address prior to the send-email step. This works but I (or more specifically, my users) need to remember to do this for every single email step that is created.
Theoretical solutions
Ideally, I would have a child workflow that would accept an email object as input and then I'd run a little check to confirm that there is a sender and recipient before sending the email. If data is missing I could either silently fail the sub-process or invoke different logic such as email the originating user or write an error record.
Howver, given the following....
Custom workflow assemblies are still not supported in CRM Online
Workflows do not accept incoming parameters
Even dialogs don't support an "email object" as an input parameter, or an array of values (e.g. for recipients) as an input parameter
Child dialogs do not return control to the caller after completion
...I am struggling to conceive of a pattern or solution that would effectively allow me to avoid the users having to remember to put a hard-coded check in every workflow or dialog that they create (to check for the presence of a recipient email address).
Ideally I want something like a generic child-workflow that takes the email object (or a serialisation or other representation of it), makes the checks and sends the email if it can.
Over to you
I've tried to design a custom solution but it quickly gets over-engineered (plugins on system entities etc). Otherwise I can't see a way of avoiding putting the onus on the users. Has anyone else encountered a similar requirement and better still, devised a solution?
Well I can think of a pretty straight forward solution.
New field on email - "Auto Send", bit, default No
New workflow - Create of Email, If "Auto Send" == Yes && Send contains data && Recipient contains data -> Send Email in context
In all your other workflows, instead of using the "Send Email" action, use the "Create Record" action to create an email record, populate the email as normal, but also populate the "Auto Send" field.
This way users can pretty much create an email as normal, but you get to use a single workflow to perform validation logic and actually send it.

Which users are currently connected to an Openfire Jabber server?

I have got an Openfire Jabber server with in excess of 75,000 users listed. Of those, 150 or more can be online at any one time.
Is there anywhere that I can collect the JIDs (usernames) of the currently logged in users? I have full database access to the underlying data, but the server does not appear to write the current status back to the DB. Because of the number of users, rosters are not being used.
A very useful set of data being returned would be from a simple (password protected) webpage with one JID per line, optionally with the login time, and maybe also the last time that account performed an action [like send a message]. The latter two are not as essential, but would be useful if the data is available, as well as any other information that was available regarding the user session.
dont know if this will help but I ran into it looking for similar functionality. As defined in XEP-0045 http://xmpp.org/extensions/xep-0045.html#disco-roominfo :
An implementation MAY return a list of existing occupants if that information is publicly
available, or return no list at all if this information is kept private. Implementations
and deployments are advised to turn off such information sharing by default.
So you would need to ensure it works as advertised on Openfire (all xmpp servers ive come across have a bug or two in them), and I imagine you would need to code some logic to get the results.
Good luck.
Not a perfect answer, but the query you want is probably embedded in the session-summary.jsp page. I got to it on a locally hosted server at http://localhost:9090/session-summary.jsp. What I don't know is if that is then stored in the database where it is query-able, or if it is stored internally to the client. The latter is more likely.
The data that page displays is Name, Resource, Status, Presence, Priority, Client IP, and Close Connection.