This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$client = User::getClient(); | |
$facebook_id = null; | |
$connection_result = $client->oauth->connection->search(array( | |
"user_id" => "self" | |
)); | |
foreach($connection_result->items as $connection){ | |
if($connection->provider_id == 'facebook'){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getApproximateElapsedTime(date) { | |
var timeDelta = new Date().getTime() - date.getTime(); // ms | |
var map = [ | |
{ unit: 1000, singular: "%d second", plural: "%d seconds" }, | |
{ unit: 60, singular: "%d minute", plural: "%d minutes" }, | |
{ unit: 60, singular: "%d hour", plural: "%d hours" }, | |
{ unit: 24, singular: "%d day", plural: "%d days" }, | |
{ unit: 29.53, singular: "%d month", plural: "%d months" }, // Avg. days per month | |
{ unit: 12, singular: "%d year", plural: ">%d years" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Net; | |
using System.Net.Mail; | |
namespace Comfirm.Examples.Native | |
{ | |
class Program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Comfirm.AlphaMail.Services.Client; | |
using Comfirm.AlphaMail.Services.Client.Entities; | |
namespace Comfirm.Examples.AlphaMail | |
{ | |
class Person | |
{ | |
public int Id { get; set; } | |
public string UserName { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<b>Name:</b> <# payload.FirstName " " payload.LastName #><br> | |
<b>Date of Birth:</b> <# payload.DateOfBirth #><br> | |
<# if (payload.Id != null) { #> | |
<a href="http://company.com/sign-up">Sign Up Free!</a> | |
<# } else { #> | |
<a href="http://company.com/login?username=<# urlencode(payload.UserName) #>">Sign In</a> | |
<# } #> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// multiple recipients | |
$to = 'aidan@example.com' . ', '; // note the comma | |
$to .= 'wez@example.com'; | |
// subject | |
$subject = 'Birthday Reminders for August'; | |
// message | |
$message = ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// to, subject, body | |
mail('test@test.com', 'My Subject', "My awesome body text"); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'class.phpmailer.php'; | |
$mail = new PHPMailer(); | |
$mail->IsSMTP(); | |
$mail->IsHTML(true); | |
$mail->Host = 'smtp1.example.com'; | |
$mail->SMTPAuth = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'lib/swift_required.php'; | |
$transport = Swift_SmtpTransport::newInstance('smtp.example.org', 25) | |
->setUsername('your username') | |
->setPassword('your password'); | |
$mailer = Swift_Mailer::newInstance($transport); | |
$message = Swift_Message::newInstance('Wonderful Subject') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include_once("comfirm.alphamail.client/emailservice.class.php"); | |
$email_service = AlphaMailEmailService::create() | |
->setServiceUrl("http://api.amail.io/v1") | |
->setApiToken("YOUR-ACCOUNT-API-TOKEN-HERE"); | |
$notification = array( | |
"user" => array( | |
"name" => "John" |
OlderNewer