Sitecore Web Forms for Marketers - use current URL within email body - asp.net

I am trying to build a 'Tell a Friend' form for my Sitecore site using Sitecore's Web Forms for Marketers module and would like to include the URL of the current page within the body of the email. I have set the save action of my form to 'Send Email Message' and was wondering if it would be possible to use some variable to represent the URL of the current page, but can't figure out how to do it.
I noticed that if you link to a page when editing the HTML editor for the email template, the source looks something like this:
Name of page
...so perhaps it is possible to use some similar syntax to get the current context page?
I have also tried setting the save action of my form to 'Tell a Friend' but I can't see how to make this include any email content at all, let alone how to make the email include a link to the current page.
For reference I am using Sitecore 6.5.

I have an idea for this, but its more of a hack. Worth a shot:
Since the Email Editor supports inserting hooks for the dynamic fields (refer to section 4.2.2 of the WFFM User Guide [PDF]), why don't you create a Single-Line Text field on the form, call it "Current Page" and apply a unique CSS class to it (e.g. .current-page)
Using custom CSS, hide the .current-page element and using JavaScript, get the window.location.url and put its value into the .current-page input (the hidden SLT field).
Now you can use the hook [Current Page] in your email body.
Again, this is an untested idea, so I'm not sure if it will work.

Related

Autofill a form in WordPress

I am using WordPress for building my own website, And I created a form using WP form plugin and users are supposed to fill this form after entering the site and I want parts of the form to be filled automatically for them according to the login information, i.e. name.
So my question is, how can I do this?
You can use jquery or javascript, take ID of that field and run ajax on page load you will get info of use logged in and put that in your field by using jquery parameter .val()

How to pass form input values to another page in Wordpress with Elementor

I have searched the web for answer for almost a day and I couldn't find any answer about that.
Assuming that I'm having a Form created by the simple elementor form widget, and a client inserting a data there(name, email, number) and in another page I have some icon buttons(email, whatsapp, etc..) that should redirect the client to contact me
Like this one:
https://wa.me/1XXXXXXXXXX (Whatsapp start a chat link)
What I want to accomplish is that the input value from "Phone field" will replace the "1XXXXXXX" in the URL after the form is submitted
Is there any way to accomplish that? or any guide?
You can use POST method of php.
All you have to do is to create a page (i.e. submit) and then create a file in your theme folder (rather use child theme) with the name page-submit.php and write down your php code in it (use cpanel/direct admin to edit the file). Also, you should send your form to submit page, use action attribute in your form tag.

How can I have template in "Create Task" (for bug reporting) in Phabricator?

I want to have a template when people from support group want to add bugs.
Here is an example (https://github.com/photonstorm/phaser/issues/new) in GitHub that I want to implement in Phabricator if possible.
Phabricator supports customizing forms, including the 'create task' form. There are a couple of ways to go about it and they are covered in the documentation.
The simplest way to customize forms is to provide default values in the URL for the links you provide, for example, say you link to the bug submission form from your documentation. You can supply the template text as part of the link itself. This can result in long ugly URLs but that can be masked by using a url shortening service.
I'll use Wikimedia's phabricator as an example of how this works. If you want to make a link to the create task form with your template text pre-filled, you construct a url like the following:
https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?description=[insert template text here]
The other way to do this, which doesn't require you to store the template text in the url, is to edit the form and specify a default value for the description field. Editing forms is covered in the phabricator upstream documentation so I won't go into that, instead I refer you to the documentation section under the heading creating new forms.

Email to node author in Drupal 7

Drupal 7:
I need a module to append a contact form to a node of a specific content type. The form should be configurable and permit to send an email with an attachment to the node author. The form should also have a captcha. The email must not be saved in the database.
Does such module exists or do i need to develop it ?
You should be able to achieve this through the combination of the webform module, CAPTCHA module and a custom module.
Webform defines it's own 'webform' content type, but it also allows you to make other content types webform enabled by visiting 'admin/config/content/webform' and selecting the appropriate content type.
The token module provides node tokens such as nid and title which can be included as a hidden form element, but annoyingly, doesn't include the author as a token.
On the email tab of your webform, it's possible to choose a form component as the email address to send the form results to. I would create a hidden field, leaving the default value blank and then it should be fairly easy to add the node author value to it in a custom module using hook_form_alter (form id can be found by viewing source and looking for the hidden input 'form_id'). You can then use this form component in the email tab to send the results to.
The only thing I can see causing an issue is that there isn't an easy way to stop webform recording the form result in the database - I would imagine this would be achievable in a custom module without too much hassle though.
Yop, there is such a module. It's called Webform. Using Webform you can add a block form under certain node type with predefined fields and let send email directly to the node author.
Download and enable Webform 4.x
Create new from, add desired fields
Under E-mails tab for Address use token [current-page:node:author:mail]
In Form settings tab check Available as block
Configure newly enabled block (show only under certain node type + set restricted pages to the node/*/*)
Do tests
You can find printcreens and more detailed instructions here.

Embed registration page on another page in Drupal?

Currently you can get to the registration page by going here: user/register
I need to be able to embed the registration form on ANOTHER page. How do I do that?
You could try the method suggested here: http://drupal.org/node/248275
a.k.a. embed the form using the PHP Code input filter:
<?php
print drupal_get_form('user_register');
?>
However, there will be a few gotchas with trying to embed the user registration page anywhere besides /user/register, because of the way Drupal's User module is set up.
It might be better for you to form_alter the user registration form, so you can customize it to fit your needs. Or, you might be able to get by with adding a block specifically to the user registration page.
What exactly are you trying to achieve by adding the registration page somewhere else?

Resources