Skip to content

Instantly share code, notes, and snippets.

Dhanik Lal Sahni dhaniksahni

Block or report user

Report or block dhaniksahni

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dhaniksahni
dhaniksahni / WhatsAppSender.cmp
Created Sep 6, 2019
Send WhatsApp Message using Lightning Component
View WhatsAppSender.cmp
<aura:component controller="WhatsAppMessageService" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global" >
<lightning:notificationsLibrary aura:id="notifLib"/>
<div class="row">
<lightning:input aura:id="mobileNumber" name="mobileNumber" label="Mobile Number" />
<lightning:input aura:id="message" name="message" label="Message" />
</div>
<div class="row">
<lightning:button variant="brand" label="Send Message" title="Send Message" onclick="{! c.handleClick }" />
</div>
@dhaniksahni
dhaniksahni / WhatsAppMessageService.apxc
Created Sep 6, 2019
Twilio WhatsApp Message Integration in Salesforce Apex
View WhatsAppMessageService.apxc
public class WhatsAppMessageService {
@AuraEnabled
public static void send(string mobileno,string message)
{
errorResponseWrapper erw;
final String fromNumber = '+14155238886';
String account = 'ACa2e448aaa0e51ed81a56ff55b6635cca';
String token = '<your token>';
HttpRequest req = new HttpRequest();
View CaptureScreen.cmp
<aura:component controller="CommandController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:attribute name="commandText" type="string" />
<lightning:card title="Capture Screen">
<p>
<button id="start" onclick="{! c.takeScreenShot }">Start Capture</button>&nbsp;
<button id="stop">Stop Capture</button>
</p>
<div style="display: none;">
<video id="video" autoplay="true"></video>
View SignaturePad.js
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.SignaturePad=e()}(this,function(){"use strict";function t(t,e,i){this.x=t,this.y=e,this.time=i||(new Date).getTime()}function e(t,e,i,o){this.startPoint=t,this.control1=e,this.control2=i,this.endPoint=o}function i(t,e,i){var o,n,s,r=null,h=0;i||(i={});var a=function(){h=!1===i.leading?0:Date.now(),r=null,s=t.apply(o,n),r||(o=n=null)};return function(){var c=Date.now();h||!1!==i.leading||(h=c);var d=e-(c-h);return o=this,n=arguments,d<=0||d>e?(r&&(clearTimeout(r),r=null),h=c,s=t.apply(o,n),r||(o=n=null)):r||!1===i.trailing||(r=setTimeout(a,d)),s}}function o(t,e){var n=this,s=e||{};this.velocityFilterWeight=s.velocityFilterWeight||.7,this.minWidth=s.minWidth||.5,this.maxWidth=s.maxWidth||2.5,this.throttle="throttle"in s?s.throttle:16,this.minDistance="minDistance"in s?s.minDistance:5,this.throttle?this._strokeMoveUpdate=i(o.prototype._strokeUpdate,this.throttle):this._strokeMo
@dhaniksahni
dhaniksahni / DataDisplayController.cls
Created May 16, 2018 — forked from toanshulverma/DataDisplayController.cls
Sample Code to Generate PDF from Lightning components with in-memory data
View DataDisplayController.cls
public class DataDisplayController {
public String PDFData {get; set;}
public DataDisplayController(){
PDFData = '';
}
public PageReference downloadPDF(){
System.PageReference pageRef = new System.PageReference('/apex/PDFGenerator');
You can’t perform that action at this time.