Moodle: Add variable in 'a href' links in mail template - email

I have one short question for a hrev link in moodle mail template. When you are subscript to some forum, moodle start to send you a emails from every replay with content where you also have a href links. How can I add same variable in a href link in moodle mail. Explanation, if I reply to some forum , I received email where I have link http://moodle.com/mod/forum/discuss.php?d=132 , now can I add new variable to link and when I will received mail to have link something like this: http://moodle.com/mod/forum/discuss.php?d=132&varialbe=germany&variable2=eu
Note:moodle send email when is activate cron.php script, not when submit replay in replay form.
I hope someone before me already have this issue or have some idea how to find solution, I will really appreciate if He/She want to share with me.
Best Regards,
J.J.

The code is in
/mod/forum/lib.php
Look for the functions
forum_make_mail_text()
and
forum_make_mail_html()
then look for
forum/discuss.php
in the code.
You can add extra parameters there, good luck! :)

Related

Joomla K2 item facebook comment notify author email

OK, so this a bit tricky, but there has to be some way to do this with facebooks FB.event?
The setup and problem.
Every K2 item (page) has a comment box.
Need to notify AUTHOR of said page when comments are made on their entries
So when someone makes an entry on the facebook comments box, I want to make sure that the specific author is notified via email that a comment has been made. I'm thinking that one would first have to create some sort of variable for each author and then connect that wwith their specific email. Then write some FB.event handler sending email based on the author.
Is there anyone who can help me figure out how to do this?
EDIT
Please follow this link
PHP variable from external file?
for a complete solution on this subject and what I was trying to accomplish here.
You need to use FB.Event.subscribe and subscribe to the comment.create event. On firing that event you can call an ajax function to send an email.
Reference: http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/
I have used K2 before and had the same problem. This auto notify functionality will soon be added to k2 core .
Currently
K2MULTINOTIFY can be used to add this functionality
Also Take a look at this k2 forum thread. Might be helpful.
http://getk2.org/community/New-to-K2-Ask-here-first/130778-Notification-of-new-comments-by-email

How can I mail a page in Confluence with showing all recipients to every recipient?

I got a confluence 3.5 installation (but I am fine too, if you tell me there is such an option in 4.2). There is a share button that let you email a page to a bunch of recipients. Sadly all recipients are entered as BCC (or the email task is executed one time for every recipient). Problem: I want to let the recipients know to whom the page has been shared too.
I cannot believe that I could not find anyhting about that topic (just that description: http://confluence.atlassian.com/display/CONF35/E-mailing+a+Page). So, if this is a silly question for you confluence cracks out there, I am sorry, but happy, if you leave me a hint.
Thank you!
Yep, this was added in Confluence 4.2 and it's really handy!
Now the email you get shows an 'Also shared with' section that has the name and avatar of everyone else.

How do I post a query string to a form field?

I have a website with a link that says "Click here to claim your prize" and that link goes to a Sales Force catch all web-to-lead form (that multiple sites use and it has a site ID that I append to the URL so the data goes to the right account)
When a user clicks that link and goes to the form page a string (in this case it's the promo code "my prize") needs to be passed to that form page and placed in the comments form field.
My questions are how is this done, are there any tutorials you could point me to, and is there a better method for accomplishing this?
What I'm trying to avoid is having the link say "Click here to win a free prize! Must enter "My Prize" in the comments" and having the user manually enter the promo code.
Thanks muchly in advance for your help!
I've used a handy jQuery script in the past called preset.js, although the instructions are not that great it's fairly simple to implement, you may have to pick through his source code though.
This question may be better on stack overflow but I found this blog post which shows example code using php and cURL to post to the web-to-lead form
http://www.paulwest.co.uk/article.php/salesforce-form-integration-with-php
This is another post about pushing leads to salesforce with php
http://sim.plified.com/2009/02/13/pushing-leads-to-salesforce-with-php/
And one more for good luck
http://www.seobywebmechanix.com/salesforce-php-form-processor-curl-tutorial
Hope these help

Magento Transactional Email Links prefixed with x-msg

Objective
Send out a Magento transactional email with a link back to the website with a variable on the end of the url.
Process
I pass a variable into Magento’s transactional email called link and display it using the following code in the email template.
<p>link = {{var link}}</p>
click here
Problem
The link is displayed correctly in the p tags e.g.
http://www.mysite.com/?param=1
However when i move the mouse over a tag i get the following link which prevents the link in the email from working:
x-msg://12/“http://www.mysite.com/?param=1”
Notes
I have tried this in Mac Mail and Hotmail and get the same result.
The url i am passing into the email needs to be dynamic and cannot be hard coded.
Thanks in advance for any assistance.
Turns out I had a funny double quote around the link.

What are some ways to protect emails on websites from spambots? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 months ago.
Improve this question
I'm creating a public internet facing website which contains the email address of their salespeople.
What kind of programming options do I have to generate the "mailto" and display the email from that address but limit the spambots from picking up the address?
Recaptcha has an excellent capture based email protection. You can see it implemented at the bottom of any page in my website using the Site Feedback link.
I know that Facebook does it by displaying an image instead of text. Sure, they could use OCR on the image, but why bother for just one email address?
If you really didn't want spam bots to get an email address, the best way is to never show it to anyone. Show a link to "Contact this person" which brings up a form. On the server side, send the contents of that form to the recipient, with a reply-to of the sender's email address. Include a little blurb at the bottom of their message that "if this email is spam, please 'click here' to block this user", which will then block the IP of the sender. I've used this method on a number of occasions and have never had a single complaint.
You can obfuscate it but IMHO whatever you do, one day spammers will get your email address. The future is in spam filters, not trying to keep email addresses secret.
What I have done in the past is use javascript to build the mailto: link. This is nice for the users because they can just click on the link and I don't know of any spambots that take the time to execute javascript yet.
I think I got the idea from Jakob Nielsen's useit.com website.
In the page header I have this piece of javascript:
<script name="mailto" language="JavaScript">
//<![CDATA[
function load()
{
c1 = "bcl"
c2 = "brian"
c3 = "lane"
c4 = "com"
// Fill in the addresses
document.getElementById("contact1").innerHTML = "" + c1 + "#" + c2 + c3 + "." + c4 + "";
}
//]]>
</script>
Tell it to load it when the page loads:
<body onload="load()">
And then in the body of the page I put a link to a spamtrap:
<span id="contact1">spam#brianlane.com</span>
If this is not a static HTML page, but a ASP.NET, JSP, Coldfusion, or PHP page then you could have a drop down box with a list of all your sales people, a text box for comments, and a "Contact Us" (ie, Submit button). When the button is clicked, it will call a server-side code which creates the email and sends it to your local mail server for delivery. The outside world will never know the email address of your sales people, nor the email format (ie, firstname.lastname#yourcompany.com) of your company.
Have a look at PrivateDaddy - I think it does exactly what you're looking for: fully automatic, unobtrusive email cloaking that even works with browsers where JavaScript support is disabled. You can get it here (free of course)
I have a solution, well, more of a theory.
Problem is, the bots parse the page. they can get the text. even if it's being put
into the page in some sophisticated way through Javascript.
So, just you CSS3 pseudo element! it won't be a link, but your email will be visible, and will never be an actual text. something like this:
.email::after{ content:'myemail#gmail.com'; }
Again, it's a theory, I've no idea how far these evil people can go to get it, but I think this be pretty safe.
Update (JULY 19')
I now in the opinion this isn't a problem since email servers have become good at filtering spam and there's no reason to make any elaborate tricks to "protect" email text on webpages.
You can use something like email obfuscation
This is a difficult problem. If you post an e-mail such that it can be parsed by a web browser so that it's clickable, then it can be parsed by a spambot. If it's not clickable (e.g. if it's an image), it's more difficult for users. On one side is perfect, seamless experience for users and on the other side is perfect spam-blocking. A simple CSS or javascript to take in an email address as separate tokens is usually better than nothing, though.
You could only show a part of the e-mail address "us...#mail.com" as a link that redirects to a captcha, then display the full e-mail address like Google Groups does.
We used to do classic ASP string cat for email addresses, the grand idea being that spambots read source, but don't parse server-side code. I have NO idea if that actually works.
Would something that I wrote work for you?
http://kevin-le.appspot.com/viewSource/sourceShare/asmRevealer.js
...and you could see the demo here:
http://kevin-le.appspot.com/extra/contact
It works with mailto, so it's convenient for users, but spambots won't be able to pick up which is your requirements. It'll be obvious once you spend 1 minute looking at the demo.
I got the same problem too and i came up with a quick but effective method to help my website out.
Basically bots just read the content of the web page but in 99.999% they do not trigger events, it would require a great amount of dedication and work, things hacker don't usually do in favor of bigger numbers and quicker effects.
So i came up with this function:
function emptyMail() {
let mail = document.querySelector('#your_mail');
let mailValue = mail.href;
mail.href = "";
mail.addEventListener('mouseover', function() {
mail.href= mailValue;
})
}
This worked for me i hope it can help you too.
I see the mailto: protocol almost dead anyway... It is convenient, but too easy to parse and gather.
Plus it has its downsides: if you are on a Web cafe, it won't work because it will call whatever default e-mail client it has (if it has any!) and it is not set up on your account. Same if you use exclusively online e-mail managers...
A possible workaround is to decorate e-mails, relying on users to type or correct them: foo (at) example.com or foo-NOSPAM#REMOVE-THIS-example.com are common schemes (hoping spammers doesn't try to decipher these common schemes!), graphical e-mail addresses are another way.
Or, as pointed out, if you can, the best option is to have a contact form, with some reasonable form of protection against robots, that would be usable from everywhere. Although people might be defiant on forms asking for e-mails (for response!), so a disclaimer might be useful too... :-)