add send to messenger button in email - email

I am making a feedback system using a facebook messenger bot. When the order is completed, then a email will be send to the user for feedback. I wanted to add "send to messenger" button in the email so that after clicking that button, a auto generated message will be send to the user's messenger for asking the feedback.
I have completed all the steps but I am not able to send the button in mail. The button does not show in the mail. The bot is still not published yet.
So how can I make the button to show?
Here is my index.html page:
<div>
<div class="fb-send-to-messenger"
messenger_app_id='1133966933290445'
page_id='944059262358972'
data-ref="123556"
color="blue"
size="standard">
</div>
</div>
<div>
<p>The "Message Us" plugin takes the user directly to Messenger and into a thread with your Page.</p>
<div class="fb-messengermessageus"
messenger_app_id='1133966933290445'
page_id='944059262358972'
color="blue"
size="standard">
</div>
</div>
I am copying the view from the browser to email. I am not using node mailer now. Is it possible to work this way if the app is still under development?

Related

Bootstrap validator submit button is not working with react api calls

I'm using bootstrap validator plugin to validate my form in react app. Everything is working fine but while integrating with api the sumbit button is not working, i mean while I click on the submit button the api call is not happening, the page is immediately gets refreshed. Below is the code
<button type="submit" name="submit" className="btn btn-primary" onClick=
{this.HandleClick}>Submit</button>
On HandleClick function we have the api call using Axios.post and I'm posting the form data to server. when we changed the type to button the call will happen and its working, but I need the button to be hidden until the form gets validated thats why i changed type as submit. Can anyone help to resolve this issue?
The page is immediately refreshed because a <button type="submit" automatically submit the form when you click on it.
You can replace type="submit" by type="button" or if you want to keep type="submit" you have to call the preventDefault function in your handler to not submit the form automatically
function HandleClick(e) {
e.preventDefault();
...
}

Submit button action

<FORM ID='htmlform' action="" onsubmit="return valforms(this)">
.....
<INPUT TYPE="submit" NAME="submit" VALUE="Submit">
When the user is done filling out the form, and clicks the submit button, I want all of the form information to be sent to me. How do I do this? This is only part of the code, the whole code is too long for me to type in here.
To reply on your question:
Oh, so like the page that emails the data is that an html page that I can have a message saying, "Thank you for your interest, you will hear back from us soon." and then have the page redirect to the home page again? I hope I'm not getting too complicated with this
You're almost right. Let me explain it to you:
the user gets a HTML page that was made in PHP, ASP,.. to fill in
some data in a form
the user fills in the data and clicks a button
The action on the button tells the server to process the page, or have another page to process it. Let's call this page PageX
PageX (written in PHP, ASP,...) will email the data to you
You can also have pageX return some text to the user's browser saying "thank you for your interest,....". You can also make a redirect to another page from this page
Does this answer your question?
The action part of the form element tells the browser what URL to post the information to. You would need to specify some page with some server-side code that would take that information and store it or send it in an email. The onsubmit part of your form element fires a JavaScript event that can be handled on the client's machine. You cannot do much on the client's machine without sending the data back to the server.

Browser won't prompt to save password

This is quite a common question but the solutions I found in other people posts are either related to a specific browser (mostly firefox) or incorrect usage of names (name="U12-678132-34")
My issues are with browsers other then Firefox (Firefox all ways works).
The form that I use is pretty standard HTML form but the submission of it is done with javascript (jQuery AJAX).
Firefox all ways asks to remember the password (if it is a new user) and refills the form if you land on that same page again. But when it comes to Chrome/Safari/IE8-9 then they never request to save a password if the form is submitted with javascript.
(By the way I did check if the browsers dont have the - never remember passwords turned on)
My submit happens when you click on the link inside the form or if you just click the "ENTER" button on your keyboard, then it initiates the $.submit() method.
Is there a specific way that the submit needs to occur so that the browser would request to save a password like firefox does? or is there a way to at least tell a specific browser like Chrome/IE to force that type of request?
Form example:
<form class="loginform" method="post" action="">
<div class="inputfield">
<input name="email" type="text" class="emailaddress inputclass" value="" title="Email Address" />
</div>
<div class="inputfield">
<input name="password" type="password" class="password inputclass" title="Password" value="" />
</div>
<div class="submit">
<div class="checking">
<img src="/preloaders/login-preloader.png"/>
</div>
<input type="submit" name="submit" value="submit" style="display:none"/>
</div>
</form>
This is browser behaviour and can't really be changed. Firefox might be "smart" enough to offer to save passwords without the form actually being submitted, but that risks having buttons in the form also trigger that option even if the button does something different. So in my opinion, it's a bad thing for Firefox to do (I've had many problems with Firefox submitting forms even though it shouldn't).
If you really want the save password option to show up, use an iframe and submit to the iframe, instead of using AJAX. You could then use AJAX from the iframe to keep the old behaviour.
attach click event to your submit button
$('#id_of_submit').click(function() {
/your ajax logic
return false;
});
and on link
$('#id_of_your_link').click(function() {
$('#id_of_submit').click();
});
this will do the trick.
Looking at the answer accepted on here - How can I get browser to prompt to save password? - it seems that a valid action might help.
But i would suggest its down to browser behaviour and cannot be controlled by HTML and/or JavaScript. If you want to remember the values entered use a Cookie
As u r doing an AJAX post, then-
Remove the <form> tags
instead of <input type="submit", use button
take the field values & AJAX post- on button click event
it might do the trick.
One of the reason is that site should have a valid certificate. If it is not secured site, password save prompt will not appear after login.

How do I get jQuery Mobile to redirect to a new page?

I'm trying to use Jquery Mobile for a web-app, and depending on what button the user clicks, redirect them to a new web page.
Example:
A user visits foo.com/index.php.
When they click login it takes them to foo.com/login.php.
That much I've been able to figure out using:
<a class="ui-block-a" data-role="button" type="submit" onclick="window.location.replace('./login.php');">Login</a>`
When I try setting href to "./login.php", it sends me to foo.com/#./login.php.
That is all well and good, but the web browser is really going to:
foo.com/index.php
foo.com/index.php#undefined
foo.com/login.php
which is causing a problem because the user has to click the back button twice.
How can I send the user from index.php to login.php without the browser trying to go to #undefined first?
I also tried:
<a class="ui-block-a" data-role="button" type="submit" onclick="window.location.replace('./login.php');" href="">Login</a>
but it still sends the viewer to foo.com/index.php# before redirecting properly.
<a href="javascript:location.replace('./login.php');" class="ui-block-a" data-role="button" type="submit" >Login</a>
Also, have you considered just simply linking to the page normally but with an attribute of rel="external" ?
try making it window.location.replace('login.php');
or window.location.replace('/login.php');

Sending gift to facebook friend from external website

I tried to use XFBML:
<fb:serverfbml style="width: 755px;">
<script type="text/fbml">
<fb:fbml>
<fb:request-form action="http://example.com/user/handleFacebookGiftSend" method="POST" invite="false" type="gifts"
<fb:multi-friend-selector
....................
on a webpage on my website to send virtual gift (consisting of simply an image and a message) to selected friends on facebook.
But then it is sent as application request ( like request to add application) even thought the application is already added by the user to whom gift is being sent. In this case the application is not facebook canvas application but an external web application running outside of facebook.
This is not right way to send a virtual gift. Ideally this should be sent as a private message to user facebook inbox informing the user that he has a gift and to view the gift, click on the link given in the message. But this option is not available. Am I right about this?
Notification would be the next best option. Is this also not available?
If none of the above available, how do I send the virtual gift link to user without showing up as application request?
Help would be greatly appreciated as I spent considerable amount of time on this before posting here.
This might be used, if you extend a MultyFriendSelector you should send an URL specified with parameters in order that it you comes back to a definite direction depending on the parameters, you might use the return of call when the user does click in the request, this one would send you to the direction URL that you find ordered in the link of the button to confirm.
For example if you want to order a gift that would be a simple image you should define in the direction of return the location of the image in your server.
<fb:fbml>
<fb:request-form
action="index.php"
method="POST"
invite="false"
type="HalloweenMosters"
content="You have received a gift from HalloweenMosters. <?php echo htmlentities("<fb:req-choice url=\"http://apps.facebook.com/YOR APP/Gifts_Manager.php?key_api="YOUR AP ID&idGift=" "\" label=\"Send a gift\"") ?>">
<fb:multi-friend-selector
email_invite="false"
import_external_friends="false"
condensed='false'
actiontext="To donate an adorable Monster to a friend"
showborder="false" rows="3" cols="4"/>
</fb:request-form>
</fb:fbml>
I hope that sickle serves...