Forum Replies Created
-
AuthorPosts
-
March 4, 2011 at 6:58 am in reply to: Return (from) Address on "Registration Complete" Free members #29732splucknettMember
> You did save the email settings after you modified them right?
Yes, I did save the settings.
But, to make sure I navigated away from the page.
Then, I loaded the page again — thus forcing the form to draw upon the stored data.
I tried that change-wp-email-from-details and that fixed the problem.
Seems like whatever that is doing would be nice to include in the “WP eMembers – Settings” email tab.
Seems odd that the other emails had the proper setting, but this one did not.
Might be nice to put a link and suggestion to use that plugin in the “Email Settings (Registration Complete)” area.
Thanks for your help by the way.
Most useful.
Claude Needham
for Susan
splucknettMemberI have posted the code from a working sample that will return a shortened url — or the original url if there was any problems.
Maybe this can help to speed up the introduction of this feature
I am new to php. (I’ve done perl, java, c++ but not much php)
So, I can’t speak for how industrial strong this code might be.
Hope it helps,
Claude Needham
<?php
function gooshrinkit($url, $key="") {
// if curl lib not around just return the url as is
if(!function_exists('curl_init')) {
return $url;
}
$apiurl = 'https://www.googleapis.com/urlshortener/v1/url';
if (!empty($key)) {
$apiurl .= '?key=' . $key;
}
$curl = curl_init();
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_URL, $apiurl);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
$longURLData = array('longUrl' => $url);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($longURLData));
$jsonResult = curl_exec($curl);
curl_close($curl);
$resultArray = json_decode($jsonResult, true);
/* if successful response looks like this
{
"kind": "urlshortener#url",
"id": "http://goo.gl/fbsS",
"longUrl": "http://www.google.com/"
}
*/
if (!isset($resultArray['id']) || empty($resultArray['id'])) {
return $url;
} else {
return $resultArray['id'];
}
} // end gooshrinkit
$longURL = 'http://galaxywebsitedesign.com/';
$shorturl = gooshrinkit($longURL);
echo $shorturl . "<br>";
$longURL = 'http://www.yoyodyneindustries.com/';
echo $shorturl . "<br>";
?>March 3, 2011 at 7:53 am in reply to: Return (from) Address on "Registration Complete" Free members #29730splucknettMemberThat would be most excellent (makes perfect sense).
But at the moment it is not using the “Prompt to complete registration” email.
Does that email go through a different handler?
The “registration complete” email had an address of the form xxxxxx@box999.bluehost.com.
The “prompt to complete registration” is of the form myname@mydomain.com
Any clues what could be causing this?
I just now double checked the “Prompt to complete registration” email. It is correct.
I then signed up a free member and the from address is clearly not the same.
It is the weirdo hosting server type address.
Thanks for any help.
Much appreciated.
Claude Needham
for Susan Plucknett
splucknettMemberThanks,
That looks like it will do the trick just fine.
-
AuthorPosts