{"id":1406,"date":"2020-07-24T11:13:55","date_gmt":"2020-07-24T11:13:55","guid":{"rendered":"https:\/\/staging.txtbox.in\/docs\/developers\/?post_type=lsvr_kba&#038;p=1406"},"modified":"2020-07-24T11:13:56","modified_gmt":"2020-07-24T11:13:56","slug":"send-a-mms-message-from-apex","status":"publish","type":"lsvr_kba","link":"https:\/\/staging.txtbox.in\/docs\/developers\/knowledge-base\/send-a-mms-message-from-apex\/","title":{"rendered":"Send a MMS Message from Apex"},"content":{"rendered":"\n<p>For sending MMS through a dev console or custom code, the following things are required:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>SMS History record is to be created with smagicinteract__Message_Type__c field as \u2018MMS\u2019<\/li><li>The MMS Detail record is to be created with a lookup of the SMS History record that was created in the previous step&nbsp;<\/li><\/ol>\n\n\n\n<p>Refer the below sample script to send MMS:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">smagicinteract__smsMagic__c smsobj = new smagicinteract__smsMagic__c();\nsmsobj.smagicinteract__PhoneNumber__c = '919623197650';\nsmsobj.smagicinteract__Unformatted_Phone_Number__c = '919623197650';\nsmsobj.smagicinteract__SenderId__c = 'SMSSenderId';\nsmsobj.smagicinteract__disableSMSOnTrigger__c = 0;\nsmsobj.smagicinteract__SMSText__c = 'testSMS 2';\nsmsObj.smagicinteract__Message_Type__c = 'MMS';\nsmsObj.smagicinteract__MMS_Subject__c = 'Some random subject';\nsmsobj.smagicinteract__external_field__c = ApexAPI.generateUniqueKey();\ninsert smsObj;\n\nsmagicinteract__MMS_Detail__c mmsObj = new smagicinteract__MMS_Detail__c();\nmmsObj.smagicinteract__MMS_Filename__c = 'Image';\nmmsObj.smagicinteract__MMS_Url__c = ';\nmmsObj.smagicinteract__SMS_History__c = smsObj.id;\ninsert mmsObj;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>For sending MMS through a dev console or custom code, the following things are required: SMS History record is to be created with smagicinteract__Message_Type__c field as \u2018MMS\u2019 The MMS Detail record is to be created with a lookup of the SMS History record that was created in the previous step&nbsp; Refer the below sample script [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"lsvr_kba_cat":[153],"lsvr_kba_tag":[],"class_list":["post-1406","lsvr_kba","type-lsvr_kba","status-publish","format-standard","hentry","lsvr_kba_cat-sms-magic-for-developers"],"_links":{"self":[{"href":"https:\/\/staging.txtbox.in\/docs\/developers\/wp-json\/wp\/v2\/lsvr_kba\/1406","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staging.txtbox.in\/docs\/developers\/wp-json\/wp\/v2\/lsvr_kba"}],"about":[{"href":"https:\/\/staging.txtbox.in\/docs\/developers\/wp-json\/wp\/v2\/types\/lsvr_kba"}],"author":[{"embeddable":true,"href":"https:\/\/staging.txtbox.in\/docs\/developers\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/staging.txtbox.in\/docs\/developers\/wp-json\/wp\/v2\/comments?post=1406"}],"version-history":[{"count":1,"href":"https:\/\/staging.txtbox.in\/docs\/developers\/wp-json\/wp\/v2\/lsvr_kba\/1406\/revisions"}],"predecessor-version":[{"id":1407,"href":"https:\/\/staging.txtbox.in\/docs\/developers\/wp-json\/wp\/v2\/lsvr_kba\/1406\/revisions\/1407"}],"wp:attachment":[{"href":"https:\/\/staging.txtbox.in\/docs\/developers\/wp-json\/wp\/v2\/media?parent=1406"}],"wp:term":[{"taxonomy":"lsvr_kba_cat","embeddable":true,"href":"https:\/\/staging.txtbox.in\/docs\/developers\/wp-json\/wp\/v2\/lsvr_kba_cat?post=1406"},{"taxonomy":"lsvr_kba_tag","embeddable":true,"href":"https:\/\/staging.txtbox.in\/docs\/developers\/wp-json\/wp\/v2\/lsvr_kba_tag?post=1406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}