Contact Form 7 recipients from API AJAX call - ajax

I am wondering if there is a way to make a dynamic recipient from AJAX API call for Contact Form 7 WordPress.
https://sevenspark.com/docs/contact-form-7-dynamic-text-extension

Related

EWS Calendar Attendees

I am working with the Exchange Web Service and am able to retrieve calendar events using the FindItem function. I have the function returning the IDOnly and making an additional call to GetItem to get all the properties. I am able to get everything I need with the exception of Attendees who are outside of the firm.
For example, if my company has john#abc.com and joe#abc.com email accounts and I have a calendar item with both, the EWS API is correctly returning both those are attendees.
However, if I create an event with john#abc.com and johnsmithxxxxx#gmail.com, the gmail address does not get returned in the API response even though it shows up within Outlook. Is this by design or do I need to specify some additional parameter to have the EWS API return ALL attendees regardless if they have a mailbox on the exchange server or not?

How to handle Stripe payment failure via AJAX, with standard page load for success? (using Laravel backend)

I've got a long and fairly complex form for a booking system that a user fills in, then pays using Stripe Checkout. I'm trying to figure out the best solution to both handle payment failure easily (so submitting form over AJAX so I don't have to try and regenerate the whole booking form with all the data the user's entered), whilst also handling payment success gracefully (so with a new page showing a booking summary and a different URL so if user clicks reload button in their browser it doesn't just take them back to the search results and booking form again)
I'm using a mixture of Laravel 5.4 and JS/JQuery to generate the booking form on the front end, and after Stripe Checkout (I'm using their standard simple integration pop up) it submits all the form + Stripe token etc back to a POST route in my Laravel backend. In my controller, I then try and charge the credit card using standard Stripe API and process the booking details into my database, and then return a Laravel view from a Blade template thus giving the user a different page and URL. As mentioned I want to switch the form submission to AJAX so payment failure can be handled easily (i.e. their big filled in form doesn't disappear, and just an alert pops up to user so they can try and enter a new card into the Stripe Checkout). That bit's fine, I'll just use this: https://stackoverflow.com/a/34099169/4059141 but then in payment succeeds I basically want the same behaviour as if I'd done a regular form POST, so the new page being displayed with a new URL.
I can generate and pass back the rendered HTML from the blade template over AJAX no problem, but that leaves the original URL in the browser's address bar, so if they hit reload on the booking summary they'll just see the search results page and blank booking form again - not what I want.
Any thoughts on a solution are welcome! Thanks

Send Mailchimp Campaign to Single Email Address

I'm creating custom emails (many customizations) in MailChimp campaign builder. Looks like the only option to send is via a campaign, which I'd need to manually upload a list of email addresses. I honestly just want to use the builder to send a quality form email, that I customize for each recipient.
Is it possible to send an email to a specific email address without building a list, etc? This will probably be a one-time thing.
You can send campaign to single email address in mailchimp through this method. However you can't send the same campaign more than once to same email address.
create an automation email with API 3.0 as trigger.
Now, to send a campaign, make POST call to the given url with email address in your mailchimp
https://us19.api.mailchimp.com/3.0/automations/********/emails/********/queue
Now, To call that api you need to add HTTP BAsic Auth or OAuth 2 to API Request. See this answer MailChimp 3.0 HTTP POST Json Example
There's also a npm module to make life easier https://npmjs.com/package/mailchimp-api-v3
This is just a workaround as mailchimp was not built for single emails. In the longer run I'd suggest you to look into mandrill, sendgrid or other transactional email tool.
You are better off using Mandrill, MailChimp's transactional email app, to send one off emails. You can still use or at least make use of MailChimp campaigns but you can send one off emails that are customised and you do not need to send to a list

Ajax & ASP Classic Notification Display

I'm doing some updates for an intranet i created few years ago using ASP Classic. What i've been ask to do is to ALERT all users when news on intranet is added. Basically i need to check on database when news is added and than trigger an action to all intranet users saying you have New Message
I'have done a lot of research on this and i could't really find a good example for it.
Your help will be much appreciated.
Cheers
Vullnet
Basically to need to poll the server using AJAX and check for new messages.
I suppose you have a messages table with and ID that counts up. You need to track each user's last message pointer, and send this as part of your AJAX request ad a parameter. If the server's ID is higher thsn the user's then they have a new message.
Based on the AJAX response you then alert the user.
You need to make an ASP that responds to your AJAX call, Pass it a number and it responds with "OK" (not new) or "NEW".
IT works the same way, regardless of the server-side language. Use jQuery to perform your AJAX calls.

Joomla v1.6 - How & Where to set Custom Success Messages in Controller?

In Joomla! 1.6 Contact Form submission, I want to set a custom successful message, so that the front-end user can view that message after he submits the contact form.
There are 2 problems basically:-
I am using the default Contact Form component (com_contact), as provided by the Joomla! v1.6. But I am unable to find the proper area from where the contact form is submitted & the mail is being sent. So I need to know the page name & the method name of this component, firing the mail from the front-end.
How to set the custom messages (just like in the administrator panel) in the particular method of contact form component, to let the front-end user know that he has been able to successfully send the mail to the concerned staff?
Thanks in advance to all who can help.
To show Message
use $this->setMessage(JText::_('COM_YOURCOMPONENT_MESSAGE')); if you are in controller.
or use
JFactory::getApplication()->enqueueMessage(JText::_('COM_YOURCOMPONENT_MESSAGE'));
And Email is sent through JoomlaRoot / components / com_contact / controllers / contact.php
find the function submit(), the mailing code is written here.

Resources