JavaScript Embed
jQuery Requirement
Your page must include jQuery. Include the script below in the header of the webpage.
<code> <head> <script src="<a href="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js">https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js</a>" type="text/javascript"></script> </head>
If you are not sure if you have jQuery installed, complete the remaining steps, a warning will be posted to the browsers console if jQuery needs to be included.
MZCAPIJS Requirement
After jQuery has been loaded on the page, now add the following above the closing tag of the body.
<code> <body> ... <div></div> ... <script type="application/javascript"> let mzcapiConfig = { webToText: { triggeredSendProfileKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', ctaText: "Click to Text to Phone", modalWindow: { title: "Send This Item To Your Mobile Phone", description: "Enter your mobile number to have this item's details sent to your phone via text message.", logo: "<a href="https://mobilozophy.com/wp-content/uploads/2021/07/mobilozophy-logo.png">https://mobilozophy.com/wp-content/uploads/2021/07/mobilozophy-logo.png</a>", submit: "Submit", cancel: "Cancel" }, messageParams: { content: 'Hello World! This is a test!' }, } } </script> <script src="/api/js/mzcapi?public=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&account=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"></script> </body>
Mobilozophy will provide you with the following credentials:
- triggeredSendProfileKey
- public
- account
The div with class mzcapi-web-to-phone will be the placeholder on the page that will render a link which will open the modal window below. The text value of this link can be customized by changing the value of ctaText.
Modal Window Prompt
In the code above, the modal window can be configured with the follwing parameters
- title
- description
- logo
- submit
- cancel
For support questions please email support@mobilozophy.com