静的リソースにいくつかの画像をアップロードしました。これらの画像を VF ページのメールテンプレートに含めると、画像がメールに表示されません。代わりに「X」マークが表示されます。
静的リソースを含めるために使用しているマークアップは以下のとおりです。
<apex:image id="theImage" value="{!$Resource.myResourceImage}" width="200" height="200"/> <apex:image url="{!URLFOR(!$Resource.TestZip, 'images/Bluehills.jpg')}" width="50" height="50" />画像がメールに表示されない理由は、画像がレンダリングされる相対 URL が value="{!$Resource.myResourceImage}" によって生成されるためです (つまり、"/resource/1312483024000/logo")。この URL は認証済みのプラットフォームユーザーしかアクセスできません。
また、画像を静的リソースとして保存する場合、項目 "Cache Control" = "Public" では、Salesforce サーバーにキャッシュされた静的リソースデータを**組織内の他のユーザー**と共有し、ロード時間を短縮するように指定します。「Public」に設定しても、Salesforce Org 外からアクセスできるようにはなりません。
この問題を解決するには、画像をドキュメントに保存し、[外部参照可] をオンにする必要があります。以下のマークアップを使用することで画像を利用できるようになります。
<apex:image id="theImage" value="https://<MyDomainName>.file.force.com/servlet/servlet.ImageServer?id=<document_id>&oid=<organization_id>" width="200" height="200"/>
000384817

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.