Guest User

Untitled

a guest
Dec 15th, 2017
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. function sendAjax() {
  2. var xhr = new XMLHttpRequest()
  3. xhr.open('POST', siteUrl + 'ajax/ajax-mailchimp.html')
  4. xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8')
  5.  
  6. xhr.onload = function() {
  7. if(xhr.status === 200) {
  8. console.log(xhr.responseText)
  9. }
  10. }
  11. xhr.send(encodeURI('action=/craftMailchimped/submittal/receiveEmail&email=fakeemailaddress@yahoo.com'))
  12. }
  13.  
  14. <?php
  15. namespace Craft;
  16.  
  17. class CraftMailchimped_SubmittalController extends BaseController {
  18.  
  19. public function actionReceiveEmail() {
  20. echo 'Wuzup?';
  21. }
  22. }
Add Comment
Please, Sign In to add comment